Sign in or Register (it’s quick!)

Forgot?
entropy
Disorder at its finest
entropy
3,169 Posts

Swap partition size

I used to know this. But what's the recommended size for a linux swap partition? The main partition for linux (Slackware, btw, only install i've had experience with) will be around 5 or 6 gigs. I just want this to play around, not for serious, long-term usage.
__________________ "Envy is ignorance; imitation is suicide..." -Ralph Waldo Emerson
"Insanity in individuals is something rare - but in groups, parties, nations and epochs, it is the rule." -Friedrich Nietzsche
TheBaron
Veteran Icrontian
TheBaron
2,784 Posts
2x the amount of ram you have, similar to the windows page file
entropy
Disorder at its finest
entropy
3,169 Posts
Thanks!
//edit
Wait, should I use ext 2 or 3? i know i can do it with the Slackware installation, but this is much quicker to do it all in one fell swoop.
Jengo
Finally Free
Jengo
2,311 Posts
ext2 is the linux standard ex3 works fine, but swap partition has its own format, im not sure of what it is tho... heh...
__________________ "I will accept any rules that you feel necessary to your freedom. I am free, no matter what rules surround me. If I find them tolerable, I tolerate them; if I find them too obnoxious, I break them. I am free because I know that I alone am morally responsible for everything I do."

- The Moon is a Harsh Mistress
skryking
Linux user since 1994
skryking
151 Posts
2x the memory use to be a pretty good standard response for this but lately I've been rethinking this. As systems are starting to come with more and more memory...for instance I just installed a desktop computer with 4GB of ram.. I think its going to take some analasys of what your going to be doing on the system to determine how much swap space to add. I think 8GB of swap space on such a system seems excessive for a desktop node, but on a server I wouldn't even shirk at giving it twice that in swap. What are y'alls thoughts on this?

Skryking
__________________ `I disapprove of what you say, but I will defend to the death your right to say it' - Evelyn Beatrice Hall


If you'd like to make a comment about something I've posted come see me at http://www.skryking.net
Rob
Icrontic Posting Maniac
Rob
339 Posts
Once you start getting into gigs of swap and ram you can start cutting back. 2x is a good guideline for smaller systems under 2G, but in reality if your using 2G of swap you have a serious problem Adding that up to 4, or 8G of swap isn't going to do anything but take longer for the machine to spiral to its death. If you have more than a gig of ram, and are using more than a couple hundred meg of swap, it doesn't matter how much you have it's going to die.

swap is filesystem type 82 I believe. You 'format' it with mkswap insted of mkfs.ext2.
lightnin
Icrontic Posting Maniac
lightnin
278 Posts
yeah, swap is it's own type. i started using 256 M of swap for anything with 512 + M of ram and it works nicely for workstations/desktops. for servers i use a little more, the 2.6 kernel tends to use more memory when it gets under a heavy load (compared to 2.4 under a heavy load) so i go with 512 M for my servers with 1 gig of ram, and 768 M for my servers with 2 gigs of ram. the math seems random but thus far this scheme has worked very well for me.
Kwitko
Body massage?
Kwitko
6,934 Posts
Thanks!
//edit
Wait, should I use ext 2 or 3? i know i can do it with the Slackware installation, but this is much quicker to do it all in one fell swoop.
Use the Reiser file system for your partitions. Swap, as Rob said, is partition type 82 and is done with mkswap.
__________________ "Is it not cruel to let our city die by degrees, stripped of all her proud monuments, until there will be nothing left of all her history and beauty to inspire our children?... this is the time to take a stand, to reverse the tide, so that we won't all end up in a uniform world of steel and glass boxes." - Jacqueline Kennedy Onassis


Rob
Icrontic Posting Maniac
Rob
339 Posts
Use the Reiser file system for your partitions.
This depends on your kernel and use. On my workstation, I use ext3 for my /boot and backup partitions and reiser for my / and /home. Sometimes this gets changed around, but that's how it's running ATM.

For servers, I use ext3 almost exclusivly.

The trick is, you MUST have the filesystem type built into the kernel and not as a module to read the /boot partition. After that, you can load modules and use other file systems. Depending on the kernel, and who rolled it, reiser is not always present. So, for production I still stick with ext3. In real world use, they are both great.
Similar Threads
Thread Thread Starter Forum Replies Last Post
The Tweaks and Tricks Thread Spinner General Software 68 9 Mar 2005 1:58pm
Does anyone get this a lot? I do! --- Warning: long log included yagga Folding@Home 4 28 Jul 2004 4:29pm
Spinner's swap file trick entropy General Software 15 8 Jun 2004 2:33am
Stripe and cluster size scott Storage 31 30 Oct 2003 5:12pm
Swap File Tweaking MERRICK Operating Systems 4 2 Oct 2003 11:11pm

Go Back   Icrontic Forums > Tech: Software > Operating Systems
Jump to
This Thread Search this Thread
Search this Thread:

Advanced Search


Current time: 3:49am (GMT)
Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Get Vanilla Forums instead. Trust me.