LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-04-2008, 10:56 AM   #1
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Creating tmpfs larger than physical ram


Say I have a machine with 512MB of ram in it and I create a 9.5GB swap partition. Then I put the necessary stuff in to /etc/fstab to mount a 10GB tmpfs partition. Is that an OK thing to do, or is it a hideously bad liable to cause the system to lock up under certain circumstances?

I've done a quick test creating a 1GB tmpfs partition and filling it by creating a big file with dd and the system kept running OK. But maybe I was lucky.

Why am I thinking of this? Because I'm thinking about a web kiosk set up where users would just be able to run Firefox and nothing else and I'd make /home a tmpfs partition for both speed and as it's wiped out by a reboot. Even with Firefox's disk cache usage left at the default 50MB there shouldn't be more than about 100MB in /home at any one time, but I'd be using hardware with only 512MB ram and I'm thinking having lots of space in /home just in case someone manages to write a bunch of stuff there (though I'd lock Firefox down and remove the file chooser dialogues) might be a good idea.
 
Old 10-05-2008, 01:50 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
While you might be able to make it work it wouldn't really have the desired effect. In fact I suspect it would likely worsen overall performance.

This is because once the physical ram is exceeded you're immediately dropping back down to disk speed when you access swap. Additionally because you've tied up almost all your physical ram with this tmpfs you'd have caused a memory constraint on the rest of your processing (remember you need for man than tmp space for running processes).

In fact this has a lot to do with the reason why most systems these days do "paging" rather than "swapping" because performance on systems that used to do heavy swapping generally was horrible.

If you truly need the additional performance you really want to increase RAM rather than try to do this.
 
Old 10-05-2008, 02:16 PM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
So you want to use disk to emulate ram to emulate a disk, odd thing.

If you really need such a huge amount of space on tmpfs, then it's definitely time to upgrade your box and buy more ram. If you are going to be swapping 9.5GB or ram at any time, your box will be definitely locked during hours to do simple tasks.
 
Old 10-05-2008, 02:22 PM   #4
huwnet
Member
 
Registered: Jan 2006
Location: England
Distribution: Arch
Posts: 119

Rep: Reputation: Disabled
Quote:
Why am I thinking of this? Because I'm thinking about a web kiosk set up where users would just be able to run Firefox and nothing else and I'd make /home a tmpfs partition for both speed and as it's wiped out by a reboot.
Perhaps it would be easier just to create a script to clear the home folder
 
Old 10-05-2008, 04:30 PM   #5
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Original Poster
Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by huwnet View Post
Perhaps it would be easier just to create a script to clear the home folder
Well yeah, wiping out the contents of /home every time the machine is rebooted is trivial. I was thinking of having /home in tmpfs for speed. There would be potentially thousands of users of the kiosk each of whom have to log in with their own usercode. So I'd have home directories created for them using pam_mkhomedir (or whatever the module's called, not on a Linux box right now) and having /home in tmps dramatically reduces the time between someone logging in and being able to do stuff. Just leaving /home on the harddisk is of course the easiest thing to do, I just like the idea of making the time between login and usability as short as possible.

But it overall it sounds like using tmpfs could potentially be more trouble than it's worth so I probably won't bother.
 
Old 10-05-2008, 04:34 PM   #6
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
You can try... It's a trivial thing to setup, but really, I doubt it's worth it.

Remember that firefox is not the lightest thing. Gtk2 and the gecko engine are two beasts in terms of ram usage, and if you are going to be using firefox all the time, your ram will most likely be filled completely almost always. That and tmpfs will bring your machine to it's knees, I bet. But, as said, trying doesn't hurt...
 
Old 10-05-2008, 04:45 PM   #7
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Original Poster
Rep: Reputation: 198Reputation: 198
Quote:
Originally Posted by i92guboj View Post
trying doesn't hurt...

It does if it fails in a production environment
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
P 501 Total ram and physical ram Ammad Linux - Hardware 2 02-20-2008 01:00 AM
Creating files larger than 2GB Nerox Programming 11 08-03-2007 06:09 PM
/proc/kcore larger than RAM malar Linux - General 10 11-23-2006 11:42 PM
Size of physical RAM bkankur Linux - General 3 07-21-2006 05:27 AM
Option of tmpfs Instead of RAMdisk when Creating Bootdisk fbagnato Linux - Newbie 2 03-27-2002 12:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration