1

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)

Hyder B.
  • 123

3 Answers3

1

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.

Hyder B.
  • 123
  • This is at least the recommendation for desktop workstations. I don't know if it is different for servers. Usually it says about 1-2x the RAM size, not more. I would rather go near 2x RAM for a server then (just guessing). – Byte Commander Mar 30 '15 at 16:57
0

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.

Mudit Kapil
  • 2,051
  • 7
  • 30
  • 47
zorus40k
  • 101
0

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.

Yonsy Solis
  • 862
  • 2
  • 8
  • 20