Linux Security: Practically Bulletproof (pt. 2) - Swap

By Jason DyokBy Ded Ryzing: How much swap space should you set aside? This is a good question and one that seems not to have an answer. You’ll see it debated all over the Internet with many varying opinions on what is correct. How much is a matter of preference and experience, but most importantly, it’s a matter of system use.

I don’t profess to have the definitive answer, but here is a breakdown of what I’ve found works for me.

1-511MB RAM Swap 2.5 x physical RAM
512MB-1GB RAM Swap 2 x physical RAM
1GB-2GB RAM Swap 1.5 x physical RAM
more than 2GB RAM Swap 1 x physical RAM

These are general guidelines and the actual use of the system should be taken into account when allocating space. For example, a system used for intensive graphics rendering would benefit from swap space signifigantly larger than that listed..

It should also be noted that if you find your system is using swap space frequently, you may want to consider increasing the amount of physical RAM. RAM is cheap these days and your system performance will benefit greatly.

Finally, if you have multiple hard drives in your system, you may want to consider spreading your swap space over all drives. This will also help increase system performance as it will accomodate simultaneous disk reads/writes.

Tags: , ,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>