I have DigitalOcean VPS, which has 2GB of memory.

I'm soon running or am about to run out of it.

How big is the performance hit if I use big swap? DO use SSD has harddrives, and I'm not the one who has to worry about SSD wearing or having shorter life span. Is it very bad idea to use swap instead more RAM?


RAM and SSD are orders of magnitude different in speed. I would suggest getting more RAM.

If you need to swap, that's fine, but you KNOW that the best long-term solution is more RAM.

  • Yes of course, but I'm more interested in short term... most of the memory is being used by apache, no mysql. Will apache2 be a lot more slower when it's forced to you swap..? – Badr Hari Aug 29 '15 at 13:27
  • I can't tell you what your application and server will do in this situation. – ewwhite Aug 29 '15 at 13:28
  • @BadrHari If it's swap thrashing it will suffer, if you have a situation where something can be swapped out but not be swapped back in in the near term it can be fine. (As the answer says, "RAM and SSD are orders of magnitude different in speed.) – Håkan Lindqvist Aug 29 '15 at 13:32
  • But do I understand swap trashing is better than having no swap at all..? In principle, if I'm not able to upgrade for more ram... all I do is serving static html pages but I have to use mod_rewrite which is memory hungry. – Badr Hari Aug 29 '15 at 13:51
  • That depends on the time of SSD and memory. With GCE, you can get 680k read iops with local SSD - which is within the same range as RAM speeds. – Lucas Nov 15 '17 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.