Fragmentation can occur when an SSD has less than 25% of free space left.
The reason for this is in how an SSD stores its data.
Your entire SSD is made out of clusters. Each cluster has sectors in it which can be filled with data.
When a file is written to your SSD, it will be written to a new cluster. It is done in such way that speed is guaranteed. When a file is removed, it will check if that cluster is empty and if so, it is marked as cleared. This is done by the function TRIM.
Now, the problem is, that at some point, your drive will be filled with enough data to make all available clusters filled with some data. This is not a bad thing, because most clusters will still have some empty space in them. When a new file is written it will then be stored in one or more of these clusters. It is here where your drive looses its speed. Not so much by how the file is stored, but because it has to find empty space rather than just finding the next empty cluster.
After your drive has been fragmented, and a file is deleted, the chance becomes small that the cluster that file was in, is completely empty. If the cluster is not empty, TRIM will not mark that cluster as cleared, and thus it will not be moved to the pool of free clusters.
So in order to fix this, first make sure you have at least 50% of free space on your SSD available, then find a defragmentation tool especially for SSD drives.
If you have another disk available, and the SSD is not running your OS, you can consider moving all your files from the SSD to another disk and then format your SSD. This will cause TRIM to mark all your clusters as empty and moving the data back will do so without causing fragmentation. Do note, this last move method is not necessarily better than a defragger. These defraggers will try to move as little data as possible while obtaining the goal, whereas moving all data to your other drive will essentially cause all clusters to be written from and to atleast two times.
One last note: The 25% of free space is a rule of thumb, not an actual established fact. Each drive is different, and with some drives it happens earlier, with some drives it happens later. So for convenience, make sure you always have at least 25% of free space on your SSD. So if your SSD is 240GB big, make sure you have at least 60GB of free space to avoid fragmentation.
7Please oh please don't defragment SSDs. Fragmentation is a problem with rotational media because of seek latency, and SSDs have practically zero seek latency. Defragmenting SSDs, in the best of cases, will have no effect whatsoever. – a CVn – 2015-09-01T19:01:10.463
1Please [edit] your question to include SMART data, ideally from both drives. – a CVn – 2015-09-01T19:01:30.427
SATA port information, make and model of the SSD drives, would also be helpful. These drivers are running before fine, how long ago, is before? – Ramhound – 2015-09-01T19:02:43.633
1I also don't really see the point in making a RAID 0 from SSDs, increasing chance of data loss yet not increasing write bandwidth significantly. – Tetsujin – 2015-09-01T19:10:01.413
1You don't mention the size or capacity of your drives. I've seen reports elsewhere that performance takes a major hit once the drive gets to 70-75% full.
If you have pretty full drives, you might consider clearing them off and testing again. – WPrecht – 2015-09-01T19:22:03.710
@MichaelKjörling this is not true. Fragmentation can still cause an SSD to become slow, but for a completely different reason than ordinary harddisks. SSD's are really quick by how it stores and retrieves data on the disk. It does this by clusters, writing files in new clusters and keeps doing so to keep the drive optimized. If you get to less than 25% of free space, it can no longer write to free clusters and it will then start to use free space inside existing clusters to store the files. If the first file in that cluster then is marked for deletion, that cluster is not cleared. As a result> – LPChip – 2015-09-01T19:54:13.703
ockquote>
fragmentation occurs. There are defraggers especially for SSD's that you can use when you freed lots of data (say, to 50% of free space) to get the most out of those clusters. Some SSD's have more space inside it than they actually hand out to allow for more clusters to store with a software limit so fragmentation does not occur that quickly. I believe the more expensive SSD's from Samsung utilize this.
– LPChip – 2015-09-01T19:56:29.260@MichaelKjörling That information is a few years out of date. Modern SSDs are so fast that the time it takes to issue and respond to I/O requests is significant and defragmentation can reduce the number of I/O requests needed to access data on the SSD. Also, modern SSDs have enough write cycles that the extra writes from strategic defragmentation won't significantly affect expected life. – David Schwartz – 2015-09-01T20:11:32.690
What make and model are the SSDs? How full are they? My bet is that your write times are so slow because writes are requiring an erase operation and erases are very slow. (Making sure TRIM is enabled and forcing a manual TRIM run may help. If the disks are less than 30% free, making space may help.) – David Schwartz – 2015-09-01T20:12:31.643
open device manager and make sure Write Caching is enabled for the SSD. – magicandre1981 – 2015-09-02T04:23:12.983
So for those still interested. They were faulty drives as when I moved them to a new PC, they effectively stopped working. – Keyvan Sadralodabai – 2016-12-15T00:47:37.063
@aCVn That might have been true in 2015, but it's not true now. Many realistic applications are IOPS-limited. If two files are the same size but one is heavily fragmented, the one that's not fragmented will take fewer IOPS to read. – David Schwartz – 2018-11-27T18:56:18.657