Swap partition size

entropyentropy Yah-Der-Hey (Wisconsin)
edited September 2004 in Science & Tech
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:D) will be around 5 or 6 gigs. I just want this to play around, not for serious, long-term usage.

Comments

  • TheBaronTheBaron Austin, TX
    edited August 2004
    2x the amount of ram you have, similar to the windows page file
  • entropyentropy Yah-Der-Hey (Wisconsin)
    edited August 2004
    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.
  • JengoJengo Pasco, WA | USA
    edited August 2004
    ext2 is the linux standard ex3 works fine, but swap partition has its own format, im not sure of what it is tho... heh...
  • edited August 2004
    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
  • RobRob Detroit, MI
    edited September 2004
    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.
  • edited September 2004
    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.
  • KwitkoKwitko Sheriff of Banning (Retired) By the thing near the stuff Icrontian
    edited September 2004
    entropy wrote:
    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.
  • RobRob Detroit, MI
    edited September 2004
    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.
Sign In or Register to comment.