Ok, so just some rough figures. But my system is a i5 2500 with 5tb in disks, non raid, and 24gb ram. Now it is mainly used as a kvm host for servers replicated on an equivalent machine. Running 3 vms with 4gb allocated to each, it leaves 12gb ram for the system. But still, while extracting large files, it is not uncommon to have top indicate about 300mb free. Ofcourse most of it can be reused since a lot if it is cached files, but at times swap can still run up to about 1.3gigs.
Performance doesn't suffer and procs util is well within limits. So allowing ample swap isn't an issue.
Monitor performance. If it gets slow. Adjust swap accordingly. But more ram does not mean less swap required.
Just a typical output of top
Code:
top - 10:16:42 up 1 day, 9:51, 2 users, load average: 1.36, 0.43, 0.14
Tasks: 242 total, 2 running, 240 sleeping, 0 stopped, 0 zombie
Cpu0 : 11.5%us, 3.1%sy, 0.0%ni, 54.2%id, 31.3%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu1 : 19.3%us, 20.1%sy, 0.0%ni, 36.6%id, 24.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu2 : 16.3%us, 16.1%sy, 0.0%ni, 27.1%id, 40.4%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 7.7%us, 7.1%sy, 0.0%ni, 64.0%id, 21.2%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 24554616k total, 24365936k used, 188680k free, 1171488k buffers
Swap: 10207224k total, 906544k used, 9300680k free, 16462432k cached
free on the other hand
Code:
free
total used free shared buffers cached
Mem: 24554616 24333872 220744 0 1171664 16388632
-/+ buffers/cache: 6773576 17781040
Swap: 10207224 906936 9300288
so as you can see even though the system is digging into swap, the system is still performing as it should. This is running 2 server virtual machines and 1 generel virtual router with only the router having a nic directly assigned. The rest uses paravirtualized drivers.
So as you can see if this system sufferes a slow down (with the previos output, that is with 3 kvm machines started up at the same time), it is more likely to be an issue with the i/o system or directly the hard disks since the cpu util is mostly bogged down waiting on disks. Even though ram is low in terms of that available, almost 18gigs are cached files that can be freed when required. So even though my swap is 10 gigs, I have never seen it go up more than 1.5 gig on this small scale system.
In my case when I experience issues, I will upgrade the disks first, maybe put them in a striped raid array if it gets slow again after that, I will update to something like the intel I350 4port nics and throw 2 in, one per pcie x 16 and make use of the SR-IOV to directly assign a port per virtual machine. That should be cheaper than just buying a new computer. So there is a real world example, this machine is used for a small business, now it is pretty low on usage because no one is logged in remotely etc since it is holidays. Sure, it is not an enterprise system, just plain desktop hardware, but the hardware does a great job for a small business.
Raid is not used, because whe have the virtual machines and configurations databases etc cloned every night to a different machine and remote server so, in case of something bad happens, it is just a matter of reprovisioning the disk image on an alternative hard disk.