How often do you run a Defrag on your SSD drive?

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

mikeymikec

Lifer
May 19, 2011
17,708
9,574
136
I think you misunderstood the article. There is an actual quote from Microsoft Developers admitting that they are not TRIMming but actually defragmenting SSDs in Windows 8.

Since the first article didn't actually cite a source and wrote a convoluted mess of an article with lots of mistakes in, I can't really take that article seriously.

The second article is more interesting, I've scan-read it and at least there aren't any glaring errors in it so far. I don't have a Win8x PC to hand so I can't test this out for myself. However, the two articles are written from completely different perspectives, the first is from someone who apparently hasn't a clue about how SSDs work, and the other is saying that there's a flaw in Win8x in that it is defragging SSDs when it shouldn't.
 
Last edited:

mikeymikec

Lifer
May 19, 2011
17,708
9,574
136
I am using AHCI and it has nothing to do with fragmentation. I am using Windows 7.

You can analyse NTFS fragmentation by starting the command prompt as an Administrator and running the analysis command:
C:\Windows\system32> defrag /a C:

It takes about 30 seconds. Please post your results.

I assumed that the defrag app UI was telling you this, hence my questions. Fine, I'll run it manually FWIW, 7%. Why are you curious about this? Would you run it on your RAM if you could?

Though I'm curious to know how you think running a fragmentation analysis has nothing to do with fragmentation.

- edit - one irritating thing about running defrag -a on an SSD on Win7 is that it updates the defrag UI with the figure. Hopefully it won't trip an option in Win7 to make it start defragging the drive in future...
 
Last edited:

ashetos

Senior member
Jul 23, 2013
254
14
76
I assumed that the defrag app UI was telling you this, hence my questions. Fine, I'll run it manually FWIW, 7%. Why are you curious about this? Would you run it on your RAM if you could?

Good question. I'm really curious because this fragmentation of logical address space of the file-system has some consequences:
1. Fragmented files need more meta-data that means more reads/writes to the SSD
2. Fragmented files mean more and smaller I/O requests instead of fewer and bigger I/O requests towards the SSD

I am curious as to what their impact to SSD performance is, and from what fragmentation percentage and up it is actually tangible to the end user.
 

hhhd1

Senior member
Apr 8, 2012
667
3
71
C:\Windows\system32>defrag /a C:
Microsoft Drive Optimizer
Copyright (c) 2013 Microsoft Corp.

Invoking analysis on (C:)...


The operation completed successfully.

Post Defragmentation Report:

Volume Information:
Volume size = 223.22 GB
Free space = 4.84 GB
Total fragmented space = 35%
Largest free space size = 503.78 MB

Note: File fragments larger than 64MB are not included in the fragmentation statistics.

It is recommended that you defragment this volume.
 

PhIlLy ChEeSe

Senior member
Apr 1, 2013
962
0
0
Good question. I'm really curious because this fragmentation of logical address space of the file-system has some consequences:
1. Fragmented files need more meta-data that means more reads/writes to the SSD
2. Fragmented files mean more and smaller I/O requests instead of fewer and bigger I/O requests towards the SSD

I am curious as to what their impact to SSD performance is, and from what fragmentation percentage and up it is actually tangible to the end user.


Defrag writes to the drive to defrag an SSD is to shorten its life, period. Enjoy your little head butting!
Now if you wanna talk speed of an SSD, I'm pretty sure yours will not compair to none defregged SSD'S................

Here's one for ya, oh I for got to Defrag it...............:sneaky:
http://i335.photobucket.com/albums/m479/jaggerwild/DEcember122014_zpsa5f78258.png


You know this thread is like the guy who posts for help with his non booting computer but "HE has built a ton of them". I can install a wall plug it doesn't make me an "electrician", build a computer is one thing, to trouble shoot them is another.
 
Last edited:

ronbo613

Golden Member
Jan 9, 2010
1,237
45
91
If you want to defrag your SSD, go ahead, see what happens. Your computer is not going to blow up and burn your house down.
 

Fred B

Member
Sep 4, 2013
103
0
0
Rewriting of fragmented log files can increase write amplification , example my ssd toolbox write to log every time it opens , now the log is 1 MB and 640 fragments .So every 1 KB it write to log it rewrites the log and amount fragments increase .By removing the file once a while it starts with 1 KB log , it is defrag without using defrag software .If there is RST services running it write a lot to log .
 

ashetos

Senior member
Jul 23, 2013
254
14
76
Defrag writes to the drive to defrag an SSD is to shorten its life, period. Enjoy your little head butting!
Now if you wanna talk speed of an SSD, I'm pretty sure yours will not compair to none defregged SSD'S................

Here's one for ya, oh I for got to Defrag it...............:sneaky:
http://i335.photobucket.com/albums/m479/jaggerwild/DEcember122014_zpsa5f78258.png


You know this thread is like the guy who posts for help with his non booting computer but "HE has built a ton of them". I can install a wall plug it doesn't make me an "electrician", build a computer is one thing, to trouble shoot them is another.

You must be such an expert, feeling superior that others are not "electricians" but you are.

"I ran a benchmark that performs raw I/O on unfragmented free-space or even worse doing raw device access! Therefore file-system fragmentation has nothing to do with SSD performance on actually fragmented files! Q.E.D."

When you don't know about a subject try to keep an open mind.
 

SSBrain

Member
Nov 16, 2012
158
0
76
Contrarily to popular belief, file system fragmentation can lead to degraded performance on an SSD too. However this is due to software limitations, not due to the SSD.

Recently I made a test with a file-fragmenting application (Passmark Fragger) to increase file system fragmentation to extremely high levels to verify this. Write and read performance on the heavily fragmented partition on a Samsung 830 SSD ended being significantly lower than that of the normal-usage partition.

bh5Hs4I.png


I also made a similar test on my main drive (a SanDisk Extreme II 480GB SSD) and I started having weird problems with VMWare/virtual machines due to the amount of file fragments (>1.2 M) in the host file system way before reaching maximum fragmentation. I remember reading that too many file fragments can degrade NTFS performance and cause problems, and I think I did experience that.

aDYBFSs.png

You can also see how sequential performance from benchmarks started degrading at this point, although not as much as with the test partition on the Samsung SSD, where I don't think the file system could be more fragmented than that.


With hard disks the system will usually become unusable way before hitting OS/filesystem overhead limits.

TL;DR:
- Extremely high file system fragmentation levels will degrade performance on SSDs too;
- An excessively high number of space and file fragments can cause unexpected problems;
- Defragmenting the file system once in a while, even on an SSD, can have long term benefits on system stability and performance. Windows 8.x will do this automatically, provided that it's not been disabled by the user.
 
Last edited:

ashetos

Senior member
Jul 23, 2013
254
14
76
snip
TL;DR:
- Extremely high file system fragmentation levels will degrade performance on SSDs too
- An excessively high number of space and file fragments can cause unexpected problems

Thanks for your time and contribution, very interesting tests and results.

I imagine cheap SSDs with low random 4k performance are affected more by fragmentation than others that legitimately reach 100K IOPS.

I find it very interesting that Windows 8 silently defragments SSDs in the background (the so called maintenance, not to be confused with scheduled TRIMming of free space) and I'm waiting for more articles on the matter from official lips.

I repeat that my year-old install of Windows 7 is at 16% fragmentation. For you Windows 8 users, that can run analysis on your system volume, if fragmentation is 0% then this must certainly mean that Windows 8 recently defragmented your SSD.
 

SSBrain

Member
Nov 16, 2012
158
0
76
By the way, I've often read people writing that defragmenting an SSD will increase the write amplification to dangerously high levels. So far I've experienced the opposite. Actually the lowest write amplification values calculated with my main SSD have been with defrag operations.

EbxYuCb.png

The third colored column shows the write amplification calculated for each row. In some cases it dropped below 1.0x, I wonder if that's the SanDisk proprietary SLC nCache at work, which supposedly decreases write amplification under certain loads.

After fragmenting files on purpose on my main SSD that much it took several attempts to bring back fragmentation levels to normal values in a reasonable amount of time. In the end I decided to copy media files on an external drive, defragmenting the data on the SSD, and then copying files back on it.

Windows 8 won't try consolidating space on an SSD as much as possible, not even by forcing this with the /X flag or executing the command several times in a row; it mostly only defragments files and won't cause any significant amount of additional writes after it determines that they have already been (which means that it's not that much of a concern for SSD endurance on a more or less regularly defragmented file system). At the end of the defrag operation, a retrim (trim) on the available free space is then automatically performed. This makes me suspect it might work differently on an SSD, perhaps trying to minimize writes.
 
Last edited:

ashetos

Senior member
Jul 23, 2013
254
14
76
Windows 7 is probably not optimized to do SSD aware defragmentation.

I would guess Windows 7 uses the same algorithm for HDDs and SSDs, if you force it to defragment.