3 ms·
It depends on what you're doing on the box. Lots of disk I/O and lots of different apps each causing a spike of RAM usage at a different time, like a typical LA
by kijin 7y ago
It depends on what you're doing on the box. Lots of disk I/O and lots of different apps each causing a spike of RAM usage at a different time, like a typical LAMP server? You probably need a bit more swap. Just one app with a very consistent RAM usage, like a database server with an explicitly configured buffer size? Then you don't need much swap. The old rule "2x RAM" actually isn't bad on a desktop PC, but it's a terrible default on a server.
Linode has been configuring 256MB swap partitions by default on their VPS for a long time, even for large plans. Maybe it's bigger for the really large plans, but I haven't tested them. Anyway it feels like a nice default, and seemed to work fine with most kinds of loads in 10+ years of usage. Some of the newer VPS services (DigitalOcean, Lightsail) come with no swap by default, and I don't feel comfortable about it so I add a 256MB swapfile on them. I do turn down the swappiness a bit, though.