Linux – SSD for swap on Ubuntu server

linuxssdswapUbuntu

Currently I am reading SSD reviews and I wonder how much exactly I will benefit if I move the 24 GB swap from 7200rpm HDD to SSD. Does anyone implemented swap space on SSD? Is this generally good idea?

On a side note: I read that ext4 has much better performance if the journal is on SSD. Anyone with such a setup?

Thanks!

Edit: Here I will answer the questions posted:
Occasionally, relatively rare I am hitting the swap. I know what the swap is for and that is better to get more RAM. When the server begins to swap its performance degrades (not a surprise). The idea is if I have few memory hungry processes running, to improve the overall system performance at that time, using SSD for swap, instead of slower rotational media. At the end – I want to be able to login faster and check the server state during swapping, instead of waiting on the login prompt. And of what I see SSD is cheaper per GB than RAM.

Would I have better server performance during swapping (as rare it is) using SSD compared to HDD? Where 10k or 15k rpm HDDs would rate in this scenario?

Thank you all for your quick and prompt answers!

Best Answer

Are you hitting swap? Generally, the better solution is to avoid that entirely, or at least make it so that things which are swapped out are genuinely not in active use, so that the speed doesn't matter. Put your money into more RAM.

This is particularly true because while high-end SSD drives may improve performance, cheap ones are very troublesome in this regard.

There is a great article on this week's Linux Weekly News which I highly recommend reading: http://lwn.net/Articles/428584/. The summary is that cheap drives are very, very sensitive to access patterns, and Linux isn't currently designed to match that well. Worse, the drives don't really expose that information in a useful way, so Linux can't necessarily do the right thing. The best best is to use them with their pre-existing FAT32 filesystems, which are factory-configured to match the drive's expectations.

Or else you should buy expensive high-performance SSDs — but only when you're already maxed out on RAM. (And really, at that point, you might strongly consider just getting a newer server which supports more RAM.)