Overclock.net banner
21 - 38 of 38 Posts

· Registered
Joined
·
523 Posts
Discussion Starter · #21 ·
Quote:
Originally Posted by MonarchX View Post

OK, so here's my SSD drive.

img

The highest number of fragmentations per any file is 499 and below. I think only a few files have 499 fragments. All others have less. I did turn off Windows 8 optimization for SSD's because optimization does NOT defrag SSD drives. It simply runs TRIM command.
Clicking the optimize button on the "Optimize Drives" window does indeed only send TRIM commands on the free space. The scheduled optimization however as long as it's enabled, will also cause the SSD to get defragmented on a system-defined, non-tweakable schedule. Did you read the link from Scott Hanselman's blog I previously provided?

You can likely see this for yourself. Try enabling the scheduled optimization, then start manually "System Maintenance" from the Action Center. Since file system fragmentation is over 10%, you will see that Windows will start defragmenting your SSD, with operation progress being reported in the "Optimize Drives" screen. From Task Manager you will see that drive load will be high, with a more or less constant and prolonged amount of writes in the several tens of MB/s being performed as well.
Quote:
Should I run the actual defragmentation on my SSD, given its state in the screenshot above?
My opinion is that you should. Windows 8.x would have anyway if you didn't disable the scheduled optimization.

Anyway, since I guess it looks almost as if I'm experimenting with other people's SSD, I've just tried with mine, which was only 5% fragmented:

Before defragmenting
11099 GB of Host Writes
24246 GB of NAND Writes



After defragmenting
11120 GB of Host Writes
24271 GB of NAND Writes


Total Host writes performed = 11120 - 11099 = 21 GB
Total NAND Writes performed = 24271 - 24246 = 25 GB
Write amplification for the amount of writes caused by system defragmentation: 25/21 = 1.19x
 

· Registered
Joined
·
84 Posts
Well, curiosity got the best of me so I did try to defrag my ssd. Took me about hour and a half. This windows 7 system is 3 years old and it was quite a bit fragmented as expected, and the most fragmented files had couple of thousand of fragments.

First thing i noticed after the defrag is that windows boot was slightly faster. About 2 "frames" of the boot animation, to be exact. I tried ASSSD and CDM, but they didnt show any improvement over the old tests. After that I started the usual programs - Firefox, Photoshop, iTunes. There was no speedup that I could measure.

I loaded old saves in Skyrim and Crysis that I use for testing performance of video card drivers and , although I never timed the loading, it feels like they are loading a second or two faster. But it could be a placebo as well. Couldn't tell the difference in TF2. Loading Dustbowl on one of my favourite servers is exactly the same as before.

Not sure what to think of this. It seems that ssd drives do benefit from defragging, but improvement in the real world results is marginal at best.

Thanks for bringing this to our attention SSBrain.
 

· Registered
Joined
·
4,601 Posts
Quote:
Originally Posted by SSBrain View Post

Clicking the optimize button on the "Optimize Drives" window does indeed only send TRIM commands on the free space. The scheduled optimization however as long as it's enabled, will also cause the SSD to get defragmented on a system-defined, non-tweakable schedule. Did you read the link from Scott Hanselman's blog I previously provided?

You can likely see this for yourself. Try enabling the scheduled optimization, then start manually "System Maintenance" from the Action Center. Since file system fragmentation is over 10%, you will see that Windows will start defragmenting your SSD, with operation progress being reported in the "Optimize Drives" screen. From Task Manager you will see that drive load will be high, with a more or less constant and prolonged amount of writes in the several tens of MB/s being performed as well.
My opinion is that you should. Windows 8.x would have anyway if you didn't disable the scheduled optimization.

Anyway, since I guess it looks almost as if I'm experimenting with other people's SSD, I've just tried with mine, which was only 5% fragmented:

Before defragmenting
11099 GB of Host Writes
24246 GB of NAND Writes



After defragmenting
11120 GB of Host Writes
24271 GB of NAND Writes


Total Host writes performed = 11120 - 11099 = 21 GB
Total NAND Writes performed = 24271 - 24246 = 25 GB
Write amplification for the amount of writes caused by system defragmentation: 25/21 = 1.19x
So you recommend just enabling Windows Optimization schedule, restarting, and waiting until it self-defragments and then run Defraggler on top of that to fully defragment the drive? OR should I keep Windows Optimization Schedule turned off and simply use Defraggler to full defrag the whole drive? I am about to have a gaming session, so I will be doing either now, but just for the hell of it I defragged all of Windows folder and all files below 1MB in size because those were fast and easy to defrag.
 

· Registered
Joined
·
523 Posts
Discussion Starter · #24 ·
Quote:
Originally Posted by Micko View Post

[...]
Not sure what to think of this. It seems that ssd drives do benefit from defragging, but improvement in the real world results is marginal at best.
I guess that most of the improvements would be from relatively small, frequently accessed files and large archives downloaded late in the system's lifetime when file system fragmentation level is the highest, which seems to be consistent with your impressions. Applications installed early might have not had their core files fragmented in the first place. I can imagine that perceived improvements would be overall marginal, although if you were to benchmark defragmented files with the File Bench program I linked in the OP you would have probably seen a more appreciable difference.

Benchmarks like AS SSD and CrystalDiskMark weren't going to improve anyway, unless file system free space was so fragmented that the temporary test file for benchmarking purposes became fragmented as well. It likely wasn't yet in your case; this is more of an issue when file system fragmentation is high and free space is low.

Quote:
Originally Posted by MonarchX View Post

So you recommend just enabling Windows Optimization schedule, restarting, and waiting until it self-defragments and then run Defraggler on top of that to fully defragment the drive? OR should I keep Windows Optimization Schedule turned off and simply use Defraggler to full defrag the whole drive? I am about to have a gaming session, so I will be doing either now, but just for the hell of it I defragged all of Windows folder and all files below 1MB in size because those were fast and easy to defrag.
I think best results would be from re-enabling the scheduled optimization and let Windows 8.x do the job over time (although it seems like a further condition for this to happen is that System Restore hasn't been disabled. Did you disable it?). You could leave Defraggler alone - why are you using it, anyway?
 

· Registered
Joined
·
4,601 Posts
Quote:
Originally Posted by SSBrain View Post

I guess that most of the improvements would be from relatively small, frequently accessed files and large archives downloaded late in the system's lifetime when file system fragmentation level is the highest, which seems to be consistent with your impressions. Applications installed early might have not had their core files fragmented in the first place. I can imagine that perceived improvements would be overall marginal, although if you were to benchmark defragmented files with the File Bench program I linked in the OP you would have probably seen a more appreciable difference.

Benchmarks like AS SSD and CrystalDiskMark weren't going to improve anyway, unless file system free space was so fragmented that the temporary test file for benchmarking purposes became fragmented as well. It likely wasn't yet in your case; this is more of an issue when file system fragmentation is high and free space is low.
I think best results would be from re-enabling the scheduled optimization and let Windows 8.x do the job over time (although it seems like a further condition for this to happen is that System Restore hasn't been disabled. Did you disable it?). You could leave Defraggler alone - why are you using it, anyway?
I am totally confused. You pretty much said that defragmenting SSD can improve performance, especially in my case. My Windows Optimizations schedule has been turned off along with System Restore. If I enable Optimization Schedule then I will have no control over how Windows will defragment my SSD and it is not likely to fully defragment it, only partially. Defraggler, however, can fully and properly defrag my SSD and HDD. I primarily used it to defrat my HDD since Windows defragger was worthless for HDD defraggig.

Makes sense now? I wanted to perform a 1 single full and thorough Defraggler SSD defragmentation, then enable the Windows native Optimization Schedule, and restart to make Windows do its thing going forward. I highly doubt it will be as effective as defragging with Defraggler though...
 

· Probably sleep deprived
Joined
·
7,681 Posts
The main reason why its always been assumed that SSDs shouldnt be defragged is twofold
1. The performance difference is theoretically not significant because defragging is about optimizing access times for non-contiguous files and an SSDs access time is already near zero
Ive had concerns on that point for a long time simply because software/firmware is still a large factor in SSD performance(as the 840 EVO issue shows)

2. It increases write cycles drastically if run on a schedule
Used to be an issue, but when most SSDs can take terabytes+ worth of writes before a single block has to be replaced I dont worry too much about it.

My conclusion has always been that its worth doing when needed, but that having a schedule for it is excessive
 

· Registered
Joined
·
523 Posts
Discussion Starter · #28 ·
Quote:
Originally Posted by MonarchX View Post

I am totally confused. You pretty much said that defragmenting SSD can improve performance, especially in my case. My Windows Optimizations schedule has been turned off along with System Restore. If I enable Optimization Schedule then I will have no control over how Windows will defragment my SSD and it is not likely to fully defragment it, only partially. Defraggler, however, can fully and properly defrag my SSD and HDD. I primarily used it to defrat my HDD since Windows defragger was worthless for HDD defraggig.
The primary reason for me telling that it would likely be advisable to make use of the Windows 8.x built-in defragmenter is that it appears to have some sort of limited SSD-awareness. I don't know how Defraggler behaves on that regard, so I can't guarantee that it won't perform an excessive or even harmful (on the long run) amount of writes if you set it on a schedule. That is something you will have to monitor yourself together with wear statistics from SMART parameters, and I can't take that responsibility for you.

To be honest though, the point of this thread was originally more making users aware that file system fragmentation can have an effect on SSDs too, with small, non-harmful tests on their own systems and sharing results+impressions rather than making (forcing?) them to set up a scheduled defragmentation regardless of what they think.
Quote:
Makes sense now? I wanted to perform a 1 single full and thorough Defraggler SSD defragmentation, then enable the Windows native Optimization Schedule, and restart to make Windows do its thing going forward. I highly doubt it will be as effective as defragging with Defraggler though...
I think I have a better solution.

If you really want to check out if defragmenting your SSD will bring some real-world difference, you could try doing 1 single Defraggler SSD defragmentation and not touching anything else (leave System Restore, Scheduled Optimization disabled like you did so far). In the worst case, you will have just performed a "once in a good while" large amount of writes, and your system will keep functioning like it did so far.
 

· Registered
Joined
·
523 Posts
Discussion Starter · #29 ·
I did some more tests that probably not many people would like to attempt.
At least on Windows 8.x, the built-in defragmenter appears to behave much differently than third-party applications such as Defraggler, from what I've seen.

Windows Defrag will mostly attempt to defragment files, without consolidating free space as much as it can (not even by forcing this with the /X flag). This means that every consecutive time it's performed it will cause a decreasing amount of writes, virtually none if most or all files have already been defragmented, leaving a relatively large amount of gaps between them.

Defraggler will instead primarily try to consolidate files as much as possible. This means that if gaps form between defragmented files over time, it will rearrange them so that most or all of the free space will be at the end of the logical block address space. This is a rather inefficient process and will of course cause a lot of writes every time. The first time I attempted it on the system drive that Windefrag wouldn't defragment any more, it caused about 240GB of Host writes, at a write amplification of about 1.15x (so, lots of writes, but not too much of a big deal). It didn't look like it would be performing any less amount of writes the second time I tried to execute it (which I canceled).

MyDefrag seems to have less dumb built-in algorithms, which, according to their description, are closer to the behavior of Windefrag. I haven't tried them in practice, though.

Bottom line: for SSDs I would advice against using defragmenters others than the Windows built-in one, which will cause much less writes than one would expect if it's more or less regularly used, at least on Windows 8.x and above.

Quote:
Originally Posted by PhilWrir
The main reason why its always been assumed that SSDs shouldnt be defragged is twofold
1. The performance difference is theoretically not significant because defragging is about optimizing access times for non-contiguous files and an SSDs access time is already near zero
Ive had concerns on that point for a long time simply because software/firmware is still a large factor in SSD performance(as the 840 EVO issue shows)
Benchmarking sequential read performance of fragmented vs defragmented files shows there can be a large difference though.
I do agree however that it would likely not be too noticeable during everyday usage, as access times aren't affected, unlike hard disks.
Quote:
2. It increases write cycles drastically if run on a schedule
Used to be an issue, but when most SSDs can take terabytes+ worth of writes before a single block has to be replaced I dont worry too much about it.
I think this mostly depends on the frequency of such schedule.

In my experience (I've made many tests over time just to see if what people kept telling was actually true), defragmenting a partition that hasn't been for a very long time or using wasteful defragmenting patterns will indeed cause many writes, but a single time defragmentation task won't burn out cycles dramatically. Writes caused by defragmentation appear to generally have a very low write amplification, close to 1x. Also, even shuffling the entire drive data around like Defraggler does, doesn't seem to cause significantly more writes than that of the used space.

Using 1 P/E monthly (which wouldn't happen when using Windows defrag) just for this doesn't seem that much of a big deal to me, even on TLC NAND-equipped SSDs.
Of course, actual benefits under real world usage would probably be debatable. That's why I think it would be interesting to read others' experience on their own drives.
 

· Registered
Joined
·
244 Posts
It's not performance related but I can think of one more advantage of SSD defragmentation, which, I believe, is being discussed very rarely or not at all. Data recoverability in case of fully trashed file allocation table. With file table(s) lost all you have are fragments of files. The more fragmented file the lower chance of a successful recovery. It is probably negligible for Windows 8.x (with its defragmentation/optimization routines) but may be little more important for some users of Windows 7 (and below). See the first paragraph of the message #22
wink.gif


What do you think?
 

· Registered
Joined
·
157 Posts
I can heartily recommend the MyDefrag flash memory script which I've been using about every 1-2 months for a few years now. Can even set it up as a monthly scheduled task if you wish.

My SSD can get quite heavily fragmented sometimes because I use NTFS compression for a lot of things (saves a lot of space on my OS drive and quite a bit on my gaming one too). I turn it off for folders or files where most of the activity is writes though, because that creates a lot of fragmentation as well as using quite a few CPU cycles.
 

· M'aiq the Liar
Joined
·
10,445 Posts
Quote:
Originally Posted by Micko View Post

Well, curiosity got the best of me so I did try to defrag my ssd. Took me about hour and a half. This windows 7 system is 3 years old and it was quite a bit fragmented as expected, and the most fragmented files had couple of thousand of fragments.

First thing i noticed after the defrag is that windows boot was slightly faster. About 2 "frames" of the boot animation, to be exact. I tried ASSSD and CDM, but they didnt show any improvement over the old tests. After that I started the usual programs - Firefox, Photoshop, iTunes. There was no speedup that I could measure.

I loaded old saves in Skyrim and Crysis that I use for testing performance of video card drivers and , although I never timed the loading, it feels like they are loading a second or two faster. But it could be a placebo as well. Couldn't tell the difference in TF2. Loading Dustbowl on one of my favourite servers is exactly the same as before.

Not sure what to think of this. It seems that ssd drives do benefit from defragging, but improvement in the real world results is marginal at best.

Thanks for bringing this to our attention SSBrain.
Why would you even attempt this without timing anything...
:doh:
 

· Registered
Joined
·
523 Posts
Discussion Starter · #33 ·
Quote:
Originally Posted by bogdankr View Post

It's not performance related but I can think of one more advantage of SSD defragmentation, which, I believe, is being discussed very rarely or not at all. Data recoverability in case of fully trashed file allocation table. With file table(s) lost all you have are fragments of files. The more fragmented file the lower chance of a successful recovery. It is probably negligible for Windows 8.x (with its defragmentation/optimization routines) but may be little more important for some users of Windows 7 (and below). See the first paragraph of the message #22
wink.gif


What do you think?
Recoverability in case of a fully trashed file allocation table doesn't seem like something many people would ever have the chance to experience, although I guess it could be a good reason for not allowing file system fragmentation rise to excessively high levels, even on SSDs. For SSDs TRIM is generally regarded ad a bigger concern/annoyance for data recoverability than fragmentation (for example in case of accidental or malicious deletion of files/folders/etc), although likely for different reasons.
 

· Registered
Joined
·
285 Posts
Quote:
Originally Posted by Fred B View Post

Made a read test with a 6MB \Windows\ntbtlog.tx from W7 the file is fragmented in 1.143 fragments and the read time is 59.04 ms with 1191 iops , now i remove the fragment and it read 25.87ms with 196 iops . From hd it is 4100.12 ms to read the log , so the punish is small but present
smile.gif
Seriously, not to be pedantic, but when you say "the file is fragmented in 1.143 fragments," do you mean one thousand one hundred and forty-three fragments? (I am assuming you do, because that would be the most logical thing in the context and because the number of fragments should be an integer--unless you are referring to, say, average fragment size for the lot.) This is confusing because you subsequently report 59.04 ms, presumably meaning fifty-nine and four one-hundredths milliseconds. In other words, I'm trying to figure out whether you mixed up how the . and , are being used. (In the US system, a comma means units of thousands and all the numbers to the right of a period are decimals/fractions.)
 

· Registered
Joined
·
285 Posts
Some info from a Microsoft employee who discussed defragmenting SSDs with Microsoft storage team developers:
Quote:
The long answer is this.

" Actually Scott and Vadim are both wrong. Storage Optimizer will defrag an SSD once a month if volume snapshots are enabled. This is by design and necessary due to slow volsnap copy on write performance on fragmented SSD volumes. It's also somewhat of a misconception that fragmentation is not a problem on SSDs. If an SSD gets too fragmented you can hit maximum file fragmentation (when the metadata can't represent any more file fragments) which will result in errors when you try to write/extend a file. Furthermore, more file fragments means more metadata to process while reading/writing a file, which can lead to slower performance.

As far as Retrim is concerned, this command should run on the schedule specified in the dfrgui UI. Retrim is necessary because of the way TRIM is processed in the file systems. Due to the varying performance of hardware responding to TRIM, TRIM is processed asynchronously by the file system. When a file is deleted or space is otherwise freed, the file system queues the trim request to be processed. To limit the peek resource usage this queue may only grow to a maximum number of trim requests. If the queue is of max size, incoming TRIM requests may be dropped. This is okay because we will periodically come through and do a Retrim with Storage Optimizer. The Retrim is done at a granularity that should avoid hitting the maximum TRIM request queue size where TRIMs are dropped."


. . .

A bit of advanced info here - Defrag will only run on your SSD if volsnap is turned on, and volsnap is turned on by System Restore as one needs the other. You could turn off System Restore if you want, but that turns off a pretty important safety net for Windows.
He then discusses what all of this means, and finally concludes:
Quote:
Yes, your SSD's file system sometimes needs a kind of defragmentation and that's handled by Windows, monthly by default [assuming you have System Restore on], when appropriate. The intent is to maximize performance and a long life. If you disable defragmentation completely, you are taking a risk that your filesystem metadata could reach maximum fragmentation and get you potentially in trouble.
http://www.hanselman.com/blog/TheRealAndCompleteStoryDoesWindowsDefragmentYourSSD.aspx
 

· To The Game
Joined
·
7,616 Posts
Guess I'll enable system restore on my SSD but limit it to 1% to allow windows to do its thing.
 

· Registered
Joined
·
285 Posts
Hmm. I don't know.
Microsoft has to consider a huge breadth of uses, considering that there are hundreds of millions of users.
What might make sense for business users might not necessarily be as good an idea in other scenarios.
I'm still inclined to keep System Restore off.
 

· To The Game
Joined
·
7,616 Posts
Quote:
Originally Posted by quipers View Post

Hmm. I don't know.
Microsoft has to consider a huge breadth of uses, considering that there are hundreds of millions of users.
What might make sense for business users might not necessarily be as good an idea in other scenarios.
I'm still inclined to keep System Restore off.
I limited it to 1% space. That's 1gb for my current SSD. Even if it did a 1gb write a day it would still take it almost 3 years to write 1 TB. Seems like a worthy trade-off for not having to deal with a fragmented drive and the performance loss that comes with it.
 
21 - 38 of 38 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top