Early this morning I decided to make a backup of my external-facing Tableau Server to get ready for 9.2. The box is an older 4-core i5 consumer machine with 32 GB of RAM that has a great low-power mode – good for running low-concurrency, low-complexity workloads without paying the utility company tons of cash.
While watching 7-Zip churn away against my extracts (my final backup file is generally about 3.1 GB), I thought it would be fun to raise the priority of the 7z.exe process itself. I used Task Manager to set it’s priority to “Real Time” not expecting much to happen since “Real Time” mode doesn’t generally effect CPU utilization of a process (unless there is already contention).
BTW, playing with this setting is not for the meek as you could totally hose your system up when other processes (mouse, keyboard, etc.) no longer have highest priority. MSDN says the following:
You should almost never use REALTIME_PRIORITY_CLASS, because this interrupts system threads that manage mouse input, keyboard input, and background disk flushing. This class can be appropriate for applications that “talk” directly to hardware or that perform brief tasks that should have limited interruptions.
…But I’m the boss of me, so I just went for it. Well, I was surprised to see that backup finished much more quickly than usual.
I broke out the online timer and tried things out WITHOUT changing the setting:
Round 1: Backup to Secondary Drive – Normal priority: 13 Minutes 8 seconds
Then I repeated, using Task Manager to set the priority of the process to Real Time
Round 2: Backup to Secondary Drive – Use Real Time priority: 4 minutes, 37 seconds
Wow. Very surprised. FYI, I also noticed that at times my screen stopped refreshing, keyboard was non-responsive, etc – Real Time at work, I guess.
Could’t believe it, so bounced the machine and tried again in reverse order and backed up to a different drive on my machine:
Round 3: Backup to Primary Drive – Use Real Time: 4 minutes, 46 seconds
Round 4: Backup to Primary Drive – Use Normal Priority: 12 Minutes 10 seconds
So there’s definitely something going on here. Interesting.
Next I tried a different Tableau Server running on Parallels on my Mac (i7, 4 core) – I saw no difference in backup time against a very similar collection of workbooks and extracts – backup completed in about 4.5 minutes in both cases.
Finally, I tried it on my main rig – a Xeon E5 with 8 cores: Again, no substantial difference: 4:09 vs. 4:07
So it appears that there may be some sort of a sweet spot for tinkering with priority on older hardware that doesn’t get completely maxed out while doing a backup for you. This trick and a million bucks will get you a million bucks.
Use at your own risk, of course.
wow, thanks for sharing! I may try it out on one of my test boxes. Is there a way to up the priority of a process within a script instead of doing it manually within task manager?
::Needs to run as Admin
::Process names are CASE SENSITIVE, so notepad.exe works but Notepad.exe does NOT
::Also, some large programs take a while to no longer show as not running,
::give this batch a few seconds timer to avoid a false result!! Timeout Value
::1 You can change the values as needed in seconds
::2 Possible values for priority: “idle”, “low”, “below normal”, “normal”, “above normal”, “high priority”, “realtime”
::3 User wmic /NODE for remote server see below example:
::wmic /NODE:ComputerNameOrIP process where name=”7z.exe” CALL setpriority “high priority”
::Script Provided as is. No warranties. Please Test before implementing.
SETLOCAL EnableExtensions
set EXE=7z.exe
:ProcessNotFound
::1 Change the number after T to change the waiting time, in seconds
TIMEOUT /T 3 /NOBREAK
:Change the process name to what ever you are looking for
FOR /F %%x IN (‘tasklist /NH /FI “IMAGENAME eq %EXE%”‘) DO IF %%x == %EXE% goto ProcessFound
goto ProcessNotFound
:ProcessFound
::2 “idle”, “low”, “below normal”, “normal”, “above normal”, “high priority”, DO NOT USE-> “realtime”
::3 Change the below to specify a different machine
echo %EXE% is running
wmic process where name=”7z.exe” CALL setpriority “high priority”
PAUSE
goto END
:END
echo 7 zip set to ludicrous speed!
I suspect that you could do this, but it wouldn’t be a simple (batch) type script – maybe PowerShell would give you access to the API you’d likely have to use, but I’m not sure.