Swap space size on multi-core systems
So far, on single core/single cpu systems, I have had good luck with making much smaller swap files than the partitioner on Ubuntu or other such systems wants to. On this machine, with a 1.0 GHz Pentium 3 and 512 MB RAM, I have never used more than 180 MB of swap. My partition is 450 MB, so I'm well covered, there.
But I am building a new system. It will have 4 cpu cores (dual sockets) System memory will be 4 GB, to start. (I can go up to 8, but I don't have the money for that.) The workload will be about the same as what I do on this machine. How much swap would you folks recommend? I'm wondering if the presence of more cores means I might use more swap. Thanks; Jack Imsdahl |
swap usage is dictated by the need for your system to have memory in excess of the physical memory available on the system. If you are not experiencing much need for swap using a single processor system, you won't experience much need for swap in a multiprocessor system presuming you have at least the same amount of RAM available and your workload is the same.
|
Typically the rule of thumb is the swap file should be 1.5 times the amount of memory you have in your machine. however i belive it caps at 2GB. Seeing as you didn't use the swap file much in your last system with only 512mb of memory having 4GB of memory in the new system i can't see the need for a massive swap file. However its a force of habit for me to follow the rule of thumb just incase i EVER will need :D
|
Quote:
Quote:
Quote:
TC, if you are going to be hibernating, then with 4GB of RAM you want like a 3GB swap (the image is compressed some). Otherwise, I can't see you ever dipping into swap unless you do video editing. Cores have no relation to swap size, only RAM does. On a 4GB non-video-editing, non-hibernating system, I'd go with like a 128MB swap, and be surprised if it needs to be used. |
Quote:
Quote:
Forgot to mention - I'm just building a similar system. FWIW, I threw a Gig of swap at it. |
You probably don't need any or a very small amount of swap space, there has been people you have 1 gb of ram who don't make a swap file or parition
|
Thanks a lot, folks
I made my decision. I went ahead and put in something of a swap file, but not much in relation to RAM, etc. I put in 750 MB swap. I just finished the install (Ubuntu Dapper; I stick with the long term support releases on my production boxes) and so far the max swap usage has shown to be 36 MB. Not much, is it?
The system is running fine now. Thanks again for the reasoned responses. |
Quote:
|
Disk is cheap - and swap is cheap insurance.
|
All times are GMT -5. The time now is 08:09 PM. |