I am currently installing Ubuntu on a new dedicated server with 8GB RAM. How much space should I allocate to the swap partition?
The server will be used to handle 50,000 visitors monthly. (Not sure if this information is helpful or not)
I am currently installing Ubuntu on a new dedicated server with 8GB RAM. How much space should I allocate to the swap partition?
The server will be used to handle 50,000 visitors monthly. (Not sure if this information is helpful or not)
Ok I got my answer after doing some researching. As a rule of thumb, it is recommended to have the same amount of RAM for the swap partition. That means if you have 8 GB of RAM, you should have 8 GB of Swap space.
Also you may want to check documentation for some additional info Swap Frequently Asked Question But generally it is recommended to have Swap partition equals to same size of System RAM.
in desktops the recommendation will always be your ram size at least, so, if you have 4GB RAM, you setup 4GB Swap. But in servers will be different, the swap usage will be more slow and problematic, because you don't have only one or two users in your desktop, you are going to serve to hundred/thousands of users in your server.
for servers i configure 512MB for much cases, and only in cases with high memory usage, i setup 2GB swap (assume that RAM wil be 2/4 GB). I try to get best RAM usage, that try to use more swap RAM used.