SSD Optimization Frequency

Bournesup

Member
The default frequency is set to daily by default. It will only invoke retrim if required. I would like to set the frequency to monthly.
 
pardon ?

SSD optimization isnt a NTlite thing, is it ? sounds more like a windows and defrag issue to me. have you tried re-scheduling your defrag program ?
 
Question is: The default optimization check frequency is daily. Since I am not a heavy pc user, you can change the frequency to monthly. I have looked in task scheduler but have not found any entries.
 
You don't optimize SSD's, since all data blocks have identical access times. If Windows recognizes your drive as SSD, defrag will correctly ignore it.
 
The default frequency is set to daily by default. It will only invoke retrim if required. I would like to set the frequency to monthly.
I'm not at my PC right now, but I think it's always been set to weekly by default. I know it is for sure on W10 at least. What windows are you on?

To solve this question for you though about changing the frequency, what I would do is take a program like RegistryChangesView by Nirsoft, open the Windows defrag, go to the schedule settings page and take a capture of the registry with that Nirsoft tool, then change the setting to monthly, then take a capture again and compare. You should get a registry key that you can now integrate into NTLite so future Windows installs default to monthly.

Edit: some Google searching sounds like this is one of the few settings that isn't in a reg key, you probably have to change the trigger time in the Task Scheduler Library instead.
 
Last edited:
Code:
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Dfrg\TaskSettings]
"TaskFrequency"=dword:00000004

Daily = 2
Weekly = 3
Monthly = 4

PS - Extracted on a live system by Hellbovine's method.
 
I have already went through that exercise awhile back. If you examine the registry after a reboot that key does not exist. However, the optimization setting does through windows settings.
 
I have already went through that exercise awhile back. If you examine the registry after a reboot that key does not exist. However, the optimization setting does through windows settings.
When you say the key doesn't exist after a reboot, you mean it gets deleted for some reason and removes your changes? Instead of sending us on a goose chase, please just provide all the necessary data upfront so we know what you tried, what didn't work, etcetera. We can solve this faster if you give us all the info instead us playing tag.
 
I apologize if you think we are playing tag. The premise was perhaps I missed something and someone else solved the problem.

Now, when I make the change the key doesn't exist at all when I go check after I made the change. However, the frequency is still set to monthly.
 
Yes it is. But I have to make the change manually through windows settings. The default setting is daily. If one does a fresh install or a host refresh the setting is reverted back to daily.
 
I got onto my PC to test this, and what's going on is one of those Windows situations where things aren't intuitive or easy to modify. Here's the problem re-explained in more detail:

If you manually change the Windows Defrag schedule through the interface it works correctly. However, if you bypass that interface and instead just install the necessary registry key (TaskFrequency) via a .reg file or through Regedit, it will not work properly.

This is because there seems to be a bundled connection between the Task Scheduler Defrag task and this registry key. So when you change the registry key by itself, it won't work because it also needs to then delete the old scheduled task and replace it with a new one, and this is accomplished automatically through the Defrag schedule interface, but not when you change only the registry key.
 
Last edited:
Maybe there's no point to changing the schedule.

https://learn.microsoft.com/en-us/w...ration/windows-commands/defrag#scheduled-task
The defragmentation process runs scheduled task as a maintenance task, which typically runs every week. As an Administrator, you can change the how often the task runs by using the Optimize Drives app.
  • When run from the scheduled task, defrag uses the below policy guidelines for SSDs:
    • Traditional optimization processes. Includes traditional defragmentation, for example moving files to make them reasonably contiguous and retrim. This is done once per month. However, if both traditional defragmentation and retrim are skipped, then analysis isn't run. Changing the frequency of the scheduled task does not affect the once per month cadence for the SSDs.
    • If you manually run traditional defragmentation on a SSD, between your normally scheduled runs, the next scheduled task run performs analysis and retrim, but skips traditional defragmentation on that SSD.
    • If you skip analysis, you won't see an updated Last run time in the Optimize Drives app. Because of that, the Last run time can be up to a month old.
    • You might find that scheduled task hasn't defragmented all volumes. This is typically because:
      • The process won't wake the computer to run.
      • The computer isn't plugged in. The process won't run if the computer is running on battery power.
      • The computer started back up (resumed from idle).
 
Maybe there's no point to changing the schedule.
I agree. I spent several hours researching and testing this thread today since it was intriguing, and came to the same conclusion:
1) I tried integrating the registry key into a fresh install, hoping it would cause the scheduled task to update at some point, but it doesn't.

2) Defrag does indeed get set to "Daily" on a fresh install. However, as soon as Task Scheduler runs for the first time, it updates the schedule automatically to now be "Weekly" from that point forward. So no computer should continue to be set to "Daily" after it's been up and running for a while, unless you have some other tweaks that are interfering (host refresh for example), but even then it will be set back to "Weekly" eventually.

3) There's probably some script that can be put together to change the registry key, delete the old Defrag task, and create a new task, just like it does when you manipulate this through the schedule interface within Windows, but this is probably pointless because of #4 and #5 below.

4) Whether you manually run defrag/optimize, or let Task Scheduler do it, when it comes to SSD it's not defragging daily/weekly, rather it's only running analyze/trim features which quite literally take less than 3 seconds on old hardware. It also sounds like it will do an actual defrag (even on SSD) once per month regardless of what the schedule is set to (more on that below). There's basically nothing to be gained here by changing the schedule because the operating system kind of does whatever it wants to do, since it now has a more complex routine in modern Windows. If you want more control over things, you're better off disabling the schedule entirely, and then manually defragging/optimizing when you want to.

5) The entire defrag/optimize process doesn't work like most people think it does nowadays--there's so much old information, as well as misinformation, especially for SSD. This stuff changed a lot in Windows over the years with the introduction of new disk drive technology, and many websites/forums misunderstood it because computer users are so familiar with the Windows 98 era of defrag being focused on making files contiguous for an HDD. Below is a blog that has info from some Microsoft employees, and while it is outdated, the blog/comments show how things have evolved:
https://www.hanselman.com/blog/the-real-and-complete-story-does-windows-defragment-your-ssd
 
Last edited:
I remembered that thread, Vadim is hilarious in wanting to pick a fight when Scott clearly says he's only passing along what the Windows team told him. That's why devs hate talking to end users.
 
Again, I apologize to anyone that might have been offended when I started this thread. However, not everyone is aware of all the nuances of windows o/s. Especially this unusual task for optimizing drives.

I also used taskschedulerview by nirsoft and found some interesting entries for disk defragmentation. But, I think I will pass on it for now and set the schedule manually.
 
I think the shady areas are to do with Windows 7. Now I use Win7 SP1 official disc even, I even slipstream up-to-date SATA controller driver (including to boot.wim even). Upon fresh install, the defrag schedule is always set to default. It is claimed that Windows 7 should disable defrag for SSD or simply will not perform a defrag. While I didnt have the balls to select the defrag option, I came to realise that after the analyse option has been selected or/and after a CHKDSK has been performed, defragsvc becomes DISABLED. So, to clear up the bull surrounding atleast Windows 7, the idea is that the analyse option will simply detect that the disk is not HDD at this point and it will not proceed with a proper defragmentation. In my case I have found that the service is now disabled so I cannot even load up the defrag UI anymore. TRIM is always enabled just fine. In Windows 8 and onwards, if the drive shows as SSD within the UI and not HDD, there's no harm done. Defrag then just sends bulk TRIM commands to handle garbage and so on. It's tit for tat with optimization schedules, the more you do it, the less time spent on each clean up.
 
Back
Top