You are here:   Research
  |  Login

Welcome to my blog, quickest way to find articles is usually to search for them.

Minimize
Search in All Title Contents
 
     

Automatic Maintenance in Windows Server 2012 R2 is EVIL!

Jan 17 2014

OK, I don’t know who within Microsoft came up with the not-that-bright idea of enabling updates house-cleaning (which kills the CPU) in the automatic maintenance task in Windows Server 2012 R2. But if you ever wondered why the CPU is spiking on your servers about once a day, that’s why.

Update 2014-11-25: It appears that the http://support2.microsoft.com/kb/2975719 (http://support2.microsoft.com/kb/2771431 for Windows Server 2012) updates solves this issue.

Background

Shorthand, there is a scheduled task enabled by default that will kill your servers about once a day. The first time I run into to this was the night before a presentation, and suddenly my demo machine was extremely sluggish. When investigating the issue I quickly found that the TiWorker.exe was spiking my CPU.

001
TiWorker.exe spiking the CPU.

After some additional research I found I was not alone on this issue. I found a post by Lars Jørgensen which nailed it:

Server 2012 Automatic Maintenance Killed Our SAN
http://larsjoergensen.net/windows/windows-server/windows-server-2012/server-2012-automatic-maintenance-killed-san

 

Action Center

The automatic maintenance job is visible in the Action Center, but the configuration are limited to say the least in that UI.  It’s way better to go straight to the source which in Windows Server 2012 R2 is scheduled tasks. Below is a screenshot of the Action Center / Automatic Maintenance, but to disable it, jump to the next section: Fixing the problem.

image
The Automatic Maintenance window in the Action Center.

Working Around the Problem

DISCLAIMER: I’m still trying to figure if disabling this task also stops the Windows update task, so please only do this on demo machines you use for presentations etc. NOT for production environments.

Anyway, since the Automatic Maintenance task is a built-in scheduled task, but if you think you can just open task scheduler as an administrator and disable it you’re wrong. As Lars pointed out in his post, you need to use the psexec utility (Sysinternals) together with schtasks.exe, and you need to run the command as SYSTEM. Use the following command:

psexec \\SERVERNAME -s schtasks /change /tn "\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /DISABLE

In my scenario, I was testing this on my Hyper-V host, so I simply skipped the \\SERVERNAME switch.

psexec -s schtasks /change /tn "\Microsoft\Windows\TaskScheduler\Maintenance Configurator" /DISABLE

image
Disabling Automatic Maintenance on my server.

image
Maintenance disabled.









Deployment News


Happy deployment, and thanks for reading!


What our lawyers makes us say:

This information is provided "AS IS" with no warranties, confers no rights and is not supported by the authors or Deployment Artist.

Copyright © 2017 by Deployment Artist (the company behind deployment research). All rights reserved. No part of the information on this web site may be reproduced or posted in any form or by any means without the prior written permission of the publisher.

Shorthand: Don't pass off our work as yours, it's not nice.

Blog Archive

Minimize




Where you can meet us!

Live Stream Recordings
ConfigMgr 1806 and W10 OSD

Windows 10 OSD Classes (US)
Dec 10, 2018, Chicago, US

Windows 10 OSD Classes (Europe)

Feb 4, 2019, Culemborg, The Netherlands

ConfigMgr CB Classes (US)
Jan 21, 2019, New York, US

Video-based trainings
https://online.truesec.com
https://deploymentartist.com/Training/Videos

MDT, Windows 10 and ConfigMgr Books
http://deploymentartist.com/Books

Contact Info
http://deploymentresearch.com/theteam