I thought that running an apparently harmless Clean-up command, the one included in the Administrative Tools, on my Windows Server 2016 would be a piece of cake and it turned out to be a complete mess. Not only hardly anything was deleted but it stalled my server. CPU and memory raised to 100% and as a consequence of this, the SQL Server engine couldn't run properly and therefore all my websites connecting to that server went down (and the phone started ringing).
After a short investigation I found out that the CPU and memory usage was up to 100%, this was caused by a process called TiWorker.exe consuming all resources [![See The Resource Monitor] 1]1. What the heck are you going to ask? Well, I indeed waited for 3 hours hoping that TiWorker.exe would end up gracefully but no, it didn't, and I had to kill it. In a matter of seconds, the server CPU and memory usage were down and all my websites were back online.
Before running that clean-up command again I am wondering if anybody around knows what happened and what to do to prevent it? Right now everything is running smoothly.