Linux - GeneralThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know this discussion is probably old for you, but I am looking to get information on swap size recommendations.
I keep reading x2 Real Memory, or less in some cases but I could not find anywhere "why".
Assume I have at least 4GB memory and a lot of disk space.
Also assume I use very heavy applications.
What should my configuration be?
Why not RealMemoryx4 for swap? or something like that.
Distribution: Arch Linux 2007.05 "Duke" (Kernel 2.6.21)
Posts: 447
Rep:
The 2x swap size thing is a bit antiquated. That standard is from the days where 32 MB of RAM was astounding, and the extra swap space was necessary. These days I don't use swap for anything over 512 MB RAM (and I really don't need it for 512 either). This is a bit biased though, as I tend to use 'light' applications rather than their larger counterparts (Openbox, Sonata and MPD, abiword etc.)
I have a linux system running right now on just over 100 MB of RAM, but that jumps when I start playing DOOM3 or something so I like to have the extra RAM
At a bare minimum, I would recommend swap size be at least equal to your physical memory. This allows you to use it as a dump-device if you should get a panic. Anything less than that and you're not going to be able to get hold of that. And changing the partition size to be big enough, once you already have panics happening, is not an easy task.
On most systems with over 512M, I go with 1.5x physical memory. 1x on one disk and .5x on a second disk (to speed up swapping should it ever happen -- which is very rare). If I had one disk, I would still do the 1.5x.
I only do 2x on systems with less than 256M. And sometimes things work out odd. I have 640M of swap on a machine which has 256M of memory just due to the circumstances of changing disks out over time.
I know a couple of gigs seems like a big amount of disk. But it's really not that much. It doesn't hurt to have it and it could really hurt to not have it if you need it.
Only works if they are at the same priority - check with "swapon -s"
This I was not aware of, since it's not required in the BSD systems I typically run. The default here is for equal priority (0). If you want to use one disk to exhaustion, before the next, you need to change that behavior. I did just google for it and discovered that this is not the default in linux. But still, it's a good thing to use if you have more than one disk as it does help make swapping a little less painful.
With that said, very few of my systems ever swap. But under heavy load, I would still expect swapping to happen occasionally even with 4GB of RAM -- since the reason you buy 4GB is because you're going to be running memory intensive stuff.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.