There have been 'rules of thumb' for swap space for many years that ran from 2xRAM to 10xRAM but these rules (for HP-UX) have been obsolete for more than 6 years!
Unfortunately, a lot of vendors and even training courses make these obsolete recommendations. So let's start with the basics:
Starting at 10.00 (and a couple of revs at 9.xx), a new parameter was introduced: swapmem_on and it was set to 1 (or any non-zero value), thus removing the original 1:1 swap vs. RAM mapping that previous versions required. If swapmem_on=0, then all processes that are running must have a reserved area in swap coresponding to the process size. To run more processes than will fit in RAM, you will need more swap space than RAM, thus the old recommendation of 2xRAM or more for swap space.
As you can see, having 8Gb of RAM where only 5Gb is ever used will mean that the 8Gb of swap space (minimum) will never be used...what a waste!
Which is why pseudo-swap was created, a bad name for what is essentially a fairly standard behavior for most other operating systems. When pseudo-swap is enabled with swapmem_on=1, there no longer needs to be a 1:1 mapping of process space into swap space. If there is more than enough memory for all processes to run at the same time, then no swap space is needed at all (strictly speaking a minimum of a few megs is needed to satisfy the opsystem).
One caveat: if processes are using memory mapped files, then some swap space will be needed for these files.
With pseudo-swap, approximately 75% of RAM needs no additional swap space. After all, they are in RAM so there is no reason to have any swap space until more than 75% of RAM is required by more processes. Then you add swap space to accomodate the overflow.
So swap is not some magic memory tool, it is simply a place to put pages of processes that are deactivated and higher priority processes need the RAM. The majority of customer system I see have 0% swap space usage, sometimes 10 or 20 Gb, completely wasted as it will never be used.
There is a place for swap space. A small RAM system (less than 1Gb) might used as a documentation server and users look up information perhaps 2-3 times per day. Such a system (I managed one for 2,000 users) would run 300-500 copies of a 5 meg process in only 256 megs of RAM. Therefore, the 2500 megs of swap was indeed required and the majority was in use. Performance was fine since very few of the processes were busy at the same time and the 'think time' was very long for each user.
Bill Hassell, sysadmin