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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-04-2008, 10:56 AM
|
#1
|
|
Member
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 982
Rep: 
|
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.
|
|
|
|
10-05-2008, 01:50 PM
|
#2
|
|
Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 5,644
|
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.
|
|
|
|
10-05-2008, 02:16 PM
|
#3
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
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.
|
|
|
|
10-05-2008, 02:22 PM
|
#4
|
|
Member
Registered: Jan 2006
Location: England
Distribution: Arch
Posts: 118
Rep: 
|
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 
|
|
|
|
10-05-2008, 04:30 PM
|
#5
|
|
Member
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 982
Original Poster
Rep: 
|
Quote:
Originally Posted by huwnet
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.
|
|
|
|
10-05-2008, 04:34 PM
|
#6
|
|
Gentoo support team
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 3,965
|
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...
|
|
|
|
10-05-2008, 04:45 PM
|
#7
|
|
Member
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 982
Original Poster
Rep: 
|
Quote:
Originally Posted by i92guboj
trying doesn't hurt...
|
It does if it fails in a production environment 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:43 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|