5

I have a very very fast SSD OCZ Revo. I want to use a lot of RAM but I'm limited to 4GB RAM for the moment. If I use my SSD OCZ Revo as swap (the whole of it, 160GB), does that mean I have effectively 164GB RAM size total?

My question is, how does linux treat swap? How can I use my SSD as RAM with the true RAM together? Anyone knows?

Hwong
  • 51

2 Answers2

7

You can perform any operations you could perform with 164GB of RAM. But because the SSD is hundreds of times slower than RAM, it will take much longer.

You will want to turn the system's swappiness up so that you can use the faster SSD swap to effectively extend the size of the page cache. Otherwise, the system will assume swap and disk are about as fast and not move things into swap when it can read them from disk, which won't make sense in your unusual situation.

If you find you have a lot of disk I/O and very little swap being used, turn the swappiness up. If you find you're "churning" the SSD, turn the swappiness down. Note that this will have some minor negative effect on the life of your SSD -- the higher the swappiness, the more the effect. (With modern SSDs, it almost doesn't matter. There's no point in having an SSD if you don't use it.)

0

Linux uses swap as a partition. I have an 18GB partition on my HDD that I formatted with GParted to be "linux-swap" I added it to /etc/fstab and it works fine (just v. slow) it would be a lot faster to use a SSD,especially a PCIe one, however using a SSD as swap may degrade it and shorten it's usable life, as SSDs have a limited number of writes..

https://wiki.archlinux.org/index.php/Solid_State_Drives#Swap_Space_on_SSDs

Tim
  • 1,288