SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-29-2006, 07:09 PM
AboveUnrefined's Avatar
AboveUnrefined AboveUnrefined is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Lords Valley, PA
Posts: 124
Send a message via AIM to AboveUnrefined Send a message via MSN to AboveUnrefined
How can I utilize a ramdisk?

Hey everyone, I was wondering if there would be a good way to impliment the 1g of RAM I have in my server... I know I definately don't need that much to run the system so here's what I want to try to do:

I'd like to keep ~300mb (or less if you think it'd be fine) for system use and then allocate the rest of memory for use while watching TV... like when I'm just surfing the channels just to see what's on.

The reason why I want to try to do this is because
1) The hard drive would be doing less work
2) I think it may attribute for a little bit more responsiveness while changing channels.
3) I also think it'll help in displaying on the server since it'll be instantaneously reading/writing... I don't know this at all though, just guessing.

My problem is that my Linux expertise is limited to the days when I had my Zaurus organizer and tweaking that out all the time... ramdisks were dictated by the kernel on that system (If I remember correctly...). I just don't know how to create the ramdisk on startup and while I look through the init.d folders it all seems pretty daunting because I don't know what phase I need to be in to create the ramdisk... I already tried it and on boot up fstab can't mount the ramdisk since it hasn't been formatted, and will always need to be reformatted on startup.

Has anybody out there tried this? Is this a waste of time to try to do?
Reply With Quote
  #2  
Old 01-30-2006, 03:03 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by AboveUnrefined
Is this a waste of time to try to do?
Sorry, but IMHO, yes!

Assuming you are wanting to use the ramdisk for liveTV video recordings...

You cannot specify a different recording directory for LiveTV, and Sage always tries to write recordings (including LiveTV) files to the disk with the most free space, so Sage is proabably never going to use the ramdisk.
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #3  
Old 01-30-2006, 07:04 AM
InsaneGeek InsaneGeek is offline
Sage User
 
Join Date: Jan 2006
Posts: 7
The way linux does it's memory is a bit different than other systems and most of the time a ramdisk gives no benefit. Linux will always try and use up all of the physical memory, if your programs aren't using the memory it will go to file buffer cache.

The nice thing is that it acts like a ramdisk but is much more flexible and "just works". Anytime you read or write something to a disk it will keep it in memory, and will stay there in memory until you filled up all available physical memory. At that point it will kick out older file data from memory and replace it with the new. Acting quite like a ramdisk but being able to be bigger (if you have more memory free than 300mb) and you don't have to worry about managing it (instead of moving files in and out of a ramdisk it works with disks themselves)

You can even prime the cache by adding a startup script that simply does a "cat [filename]" and it will put it into buffer cache immediately, provided you know which files you are going to use ahead of time (we do this at work for our search engine systems)
Reply With Quote
  #4  
Old 01-30-2006, 11:50 PM
stevech stevech is offline
Sage Icon
 
Join Date: Dec 2005
Posts: 1,643
I thought that all processes have a quota limit on memory allocation max (adjustable).
Reply With Quote
  #5  
Old 01-31-2006, 07:49 AM
InsaneGeek InsaneGeek is offline
Sage User
 
Join Date: Jan 2006
Posts: 7
Quote:
Originally Posted by stevech
I thought that all processes have a quota limit on memory allocation max (adjustable).
If I'm interpreting correctly what you are thinking, normally things aren't run with limitations by default, but you can turn them on if you want. Do a man on "ulimit" and "limits". You can run "ulimit -a" to see if you current shell has a limit set and/or check the /etc/limits file.

I'm not completely sure but I don't believe either limits or ulimit will control amount of buffer cache available to a process. You can set some kernel tuneables to tweek things if you really want to, but again it's something you have to set, default it's everything in or out gets buffered no matter the process.
Reply With Quote
  #6  
Old 02-01-2006, 06:18 PM
AboveUnrefined's Avatar
AboveUnrefined AboveUnrefined is offline
Sage Advanced User
 
Join Date: Jan 2006
Location: Lords Valley, PA
Posts: 124
Send a message via AIM to AboveUnrefined Send a message via MSN to AboveUnrefined
Quote:
Originally Posted by InsaneGeek
The way linux does it's memory is a bit different than other systems and most of the time a ramdisk gives no benefit. Linux will always try and use up all of the physical memory, if your programs aren't using the memory it will go to file buffer cache.
I have another question then... how did my zaurus use the 64Mb of ram to make 32 system and 32 storage, it was embedded in the kernel? Right from the get go the system was seen as having 32Mb of memory and another 32 of storage, which resided in the RAM. There were tons of ways to play around with it to have 48/16 58/4 60/0 etc.... as it was an organizer executing software was more than marginal when it was stored in memory than from an SD/CF card...

I was thinking it'd be the same with MPEG2 video while it was being played back for a casual user (someone who doesn't want to meddle with the guide and other features... the server is trying to act as a server with a display occasionally being used by other people who just want to channel up and down through the channels and maybe taking the next step in using the RW/FF). I just don't know how to map out the memory where it's embedded where process allocation is not done to the full 1G of RAM, but to whatever I allocated.... maybe it'd be easier to get an iRAM device (I just don't have the money to spend to get that!).

Quote:
Originally Posted by nielm
You cannot specify a different recording directory for LiveTV
Can't I just take over the default directory by doing mount /dev/ram0 /var/media/tv? Or is that somewhere else for livetv. Not that I'd want to do it for EVERYTHING... just for livetv. If I was to hit record then it can do something funky like incrementally copying the file from the ramdisk to the HDD for a seemless effect, but I don't need something that fancy really... I wouldn't mind a jerk in video when I hit record -- I usually plan my recording ahead of time anyway.

Last edited by AboveUnrefined; 02-01-2006 at 06:26 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 05:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.