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!
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.)
Ram currently costs around 10-20 GBP/Gb, SSDs are 20-40 GBP/Gb - SSD is slower than RAM and wears out faster. Can you see where I'm going with this?
64Gb is a lot of swap. How much do you actually use? Why?
Yes. There are several advantages to using SSD for swap file.
90% of data accesses are to 10% of the data. Data sets often do not fit into ram. If you are hitting the swap file, the reads and writes against the swap file can either be against a hard disc with a spinning platter or against an SSD.
Hard discs have a ~150/second limit on read/write operations per second because of seek time for the mechanical head, where as a $200 128 GB SSD can perform over 5000 IO ops per second.
Almost everyone here has said "BUY MORE RAM!!!" but unfortunately, server ram (double buffered ECC) costs 3x as much as commodity/consumer ram. For certain types of usage patterns, there is a clear price/performance advantage of SSD over ram.
SSD drives do not require installing an expensive 4 socket motherboard that supports 512 GB of expensive ECC. SSD drives are cheap and easy to add to commodity servers for storing database files or using as swap partitions.
If a $200 128 GB SSD swap partition improves performance by even 50% on a $2000 server, it is cost effective. However, you should max out the ram on the server first, given how in-expensive RAM is today.
However, the advantages of SSD for swap file usage heavily depend on your swap file patterns.
Summary: If you are doing many random access reads and few writes, you will see a large performance improvement from SSD over hard disc.
Do you actually use the swap? If so, you'll see a speed improvement using an SSD. The more you swap, the more benefit you'll see.
However I'd look at buying more RAM first.
If you are maxed out on ram already, there are also SATA RAM disks out there on the market, which look like a hard drive to the system (but obviously won't retain data after being powered off - although the ones I've looked at do offer a battery). These are worth considering as they'd provide similar (or better) performance to a SSD, without the wear issues that an SSD has.
Agree with mattdm, RAM is cheaper and better than SSD for this.
Also, check /etc/sysctl.conf for vm.swapiness option, lower means lower swapping.
If you need SSD cache - buy adapter with SSD caching support or use bcache kernel patch:
http://bcache.evilpiepirate.org/