38

I have a scheduled task that is very IO intensive (deleting hundreds of thousands of files). For disk space reasons, this job has to be performed reasonably quickly. On win2k8, scheduled tasks always have a low IO priority. Raising the priority of the process did not change the IO priority. Is there any way to get a scheduled task to have a normal IO priority?

Charlie
  • 44,214
  • 4
  • 43
  • 69
Jason Mathison
  • 1,181
  • 1
  • 10
  • 18

2 Answers2

63
  1. Create the task
  2. Right click on the task and "export" it
  3. Edit the task.xml file that you just exported
  4. You will find a line similar to <Priority>7</Priority>
  5. Change the value to a normal priority (between 4-6). A table of the potential values: TaskSettings.Priority property
    • A value of 4 will have the same I/O and memory priority as an interactive process. Values of 5 and 6 will have lower memory priority
  6. In the task scheduler, delete the task you initially created
  7. In the task scheduler, in the actions area, import the task from the XML file
Sean Saleh
  • 460
  • 5
  • 17
Jason Mathison
  • 1,181
  • 1
  • 10
  • 18
  • It works for the process that was created from a scheduled task, but a spawned process (created by that process, e.g. using "cmd \c") does not get the same priority. How to bring it to the spawned process as well? –  Aug 20 '14 at 16:19
  • 2
    4 is equal to "standard" windows priority. 5 have low memory priority (Process Explorer prompts). – CoolCmd Feb 19 '15 at 08:54
  • In 2008R2 this is correct for I/O and CPU, but does not seem to be fully correct for memory priority (also @CoolCmd): In my test, if I set the scheduled task priority to 4, it's processes (decendents) get memory priority 4. Normal interactive tasks have memory priority 5, normal scheduled tasks (scheduled task priority 7) have memory priority 3 (all read from Process Explorer). So this is still a step in between. But besides that: Thanks! – FelixD Sep 14 '17 at 11:47
  • This worked for me on child tasks of the main task. – Adam Bruss Jul 27 '22 at 15:10
1

Perhaps use IO Priority to set the process's priority?

Also, see Windows Vista: Kernel Changes - I/O, I/O, It's off to work I go...

  • I/O Completion Port Improvement[…]
  • I/O Scalability Improvements[…]
  • I/O Cancellation Support[…]
  • I/O Prioritization[…]
  • I/O bandwidth reservation
Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
x y
  • 11
  • 1