Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is swap not good when using a SSD?

On Digitalocean I came up with this message when I want to add swap:

Although swap is generally recommended for systems utilizing traditional spinning hard drives, using swap with SSDs can cause issues with hardware degradation over time. Due to this consideration, we do not recommend enabling swap on DigitalOcean or any other provider that utilizes SSD storage. Doing so can impact the reliability of the underlying hardware for you and your neighbors. This guide is provided as reference for users who may have spinning disk systems elsewhere. If you need to improve the performance of your server on DigitalOcean, we recommend upgrading your Droplet. This will lead to better results in general and will decrease the likelihood of contributing to hardware issues that can affect your service.


Why is that? I thought it was necessary for creating a stable server (not running into memory issues)

like image 319
yoano Avatar asked Aug 10 '16 12:08

yoano


People also ask

Is SSD swap as fast as RAM?

Both RAM and SSD can improve the performance of your computer. But actually, RAM is orders of magnitude faster than an SSD. In theory, the transfer speed of an SSD can be up to about 6Gbps (equivalent to 750 MB/s) which is from the SATA interface.

Can you use an external SSD with swap?

Can an SSD be used externally? Yes.

Does swap memory damage HDD?

If your system is low on RAM and it has to constantly use swap, it will not only degrade performance (the performance hit will be smaller in case you use an SSD), It will also shorten the life span of the HDD (this will be a serious problem for SSDs).

Does swap memory affect performance?

Swap usage becomes a performance problem when the Kernel is pressured to continuously move memory pages in and out of memory and swap space. Another advantage is that swap gives admins time to react to low memory issues. We will often notice the server acting slowly and, upon login, will notice heavy swapping.


1 Answers

I believe that here's your answer.

Early SSDs had a reputation for failing after fewer writes than HDDs. If the swap was used often, then the SSD may fail sooner. This might be why you heard it could be bad to use an SSD for swap. Modern SSDs don't have this issue, and they should not fail any faster than a comparable HDD. Placing swap on an SSD will result in better performance than placing it on an HDD due to its faster speeds.

like image 50
RoughTomato Avatar answered Sep 24 '22 10:09

RoughTomato