Linux – SSDs as Linux swap for large virtual mem applications

cachelinuxssdswap

This question topically touched on this, but running on 64-bit Linux, I have a set of data caching JVMs as well as wanting a large web cache. Each cache today is configured to in gross fit in system memory (24GB) and persist to disk in LRU.

I'm curious however the performance if we **over-**allocated the cache processes and set up a SSD for a high-priority Linux swap. I'm wondering if the Linux kernel may be a little smarter/faster than our simplistic LRU process?

I'm concerned with over-allocating JVM heap and having heap pages swap by the kernel as to GC it would have to traverse said pages regularly.

Best Answer

I would suggest that SSDs are not good for a swap partition because their performance degrades over time with a large number or writes. This has to do with the fact that SSDs have a limited lifetime of writes, and therefore all kinds of tricks are played to minimize the number of times a single sector is rewritten.