With traditional hard drives becoming the thing of the past, we are seeing more and more solid-state drives (SSDs) as the main storage devices in systems. Due to the sheer performance improvements an SSD provides compared to a hard drive, there is no question that SSDs will be the future of storage.
While SSD’s do provide vast speed gains, but like any storage device, it can fail. The lifespan of a SSD is related directly to how much and how often data is written to the drive. The following is some of the ideas to extend the lifespan of SSD:
1. Tweak Paging Files in Windows
Virtual memory in Windows can lead to intensive writing to the disk for swap purposes, which can degrade SSD performance and lifespan. Try to move the swap/page file from your SSD to a different disk (e.g. a hard disk drive).
2. Turn Off Hibernation (Windows Systems)
The hibernation process uses a large amount of writing capacity on the disk, disabling the function will help prolong the SSD lifespan.
C:\WINDOWS\system32>powercfg -h off
3. Do Not Run Defragmentation On Your SSD
SSDs save data as blocks and can read the blocks anywhere within the drive regardless if it’s scattered or not. Therefore, it is not necessary to run defragmentation, the process will shorten the life of the SSD due to heavy read/write action.
4. Do Not Fill Your SSD to Full Capacity
SSDs may have decreased writing speed performance when the drive reaches full capacity. When the drive is near full capacity, it requires more time to find an available space and move files around. It is recommended to have at least 25% of the free spaces to receive adequate writing speed performance.
5. Avoid Heavy Use of Swap Space
In Linux OS (Ubuntu, Centos and Red Hat), you can decrease the swap usage by adding the parameter in /etc/sysctl.conf or move the Swap partition to different storage drive (e.g. a hard disk drive).
# Decrease swap usage vm.swappiness=1
|vm.swappiness = 0||The kernel will swap only to avoid an out of memory condition, when free memory will be below vm.min_free_kbytes limit.|
|vm.swappiness = 1||Kernel version 3.5 and over, as well as Red Hat kernel version 2.6.32-303 and over: Minimum amount of swapping without disabling it entirely.|
|vm.swappiness = 10||This value is sometimes recommended to improve performance when sufficient memory exists in a system.|
|vm.swappiness = 60||The default value.|
|vm.swappiness = 100||The kernel will swap aggressively.|
6. Check Your SSD’s Health
By actively monitoring your SSD’s health, you will have a better chance of estimating its lifetime and spot checking any issues it may have. There are various tools that can help with this. For example, Smartmontools is a set of utility programs to control and monitor computer storage systems using Self-Monitoring, Analysis and Reporting Technology (S.M.A.R.T.) system built into most modern SSD and HDD.
root@ubuntu:~# apt-get install smartmontools root@ubuntu:~# smartctl -a /dev/sda smartctl 6.2 2013-07-26 r3841 [x86_64-linux-4.2.0-42-generic] (local build) Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org === START OF INFORMATION SECTION === Device Model: PNY CS1311 480GB SSD Serial Number: PNY43162193660200110 LU WWN Device Id: 5 f8db4c 431600110 Firmware Version: CS131122 User Capacity: 480,103,981,056 bytes [480 GB] Sector Size: 512 bytes logical/physical Rotation Rate: Solid State Device Device is: Not in smartctl database [for details use: -P showall] ATA Version is: ACS-2 (minor revision not indicated) SATA Version is: SATA 3.1, 6.0 Gb/s (current: 3.0 Gb/s) Local Time is: Wed Apr 19 16:22:54 2017 PDT SMART support is: Available - device has SMART capability. SMART support is: Enabled === START OF READ SMART DATA SECTION === SMART overall-health self-assessment test result: PASSED