[ntp:questions] how to change the runtime priority of NTPD on Windows

Dave Hart hart at ntp.org
Fri Feb 3 18:05:26 UTC 2012

On Thu, Feb 2, 2012 at 05:36, Ron Frazier (NTP)
<timekeepingntplist at c3energy.com> wrote:
> The NTPD service always starts out at RealTime priority.  I believe, based
> on some loopstats files, that using RealTime priority creates periodic
> spikes where the offset upwards of 35 ms or so.  Also, the graph appears to
> have random jerks in it.  When I manually switch to Above Normal priority
> using task manager, my offset excursions tend to stay within 15 ms and the
> graph is smoother.  I don't have enough data yet to prove my suspicions,
> but, I've set other programs to RealTime priority before and found that it
> destabilized the system.

Manually elevating processes to the realtime priority class is asking
for trouble, particularly for GUI programs and programs which use a
nontrivial amount of CPU.  Processes at realtime priority levels can
wedge the system by outcompeting critical system tasks.  ntpd is
designed to operate at elevated priority and sips CPU unless something
is seriously misconfigured.  In general, there's rarely a good reason
to change priorities using Task Manager.

> So, the question is, how do I force this process to always start at the
> priority that I want, rather than having to change it each time in Task
> Manager?
> I'd like to know other people's opinion on this matter.

You can't choose the priority class for ntpd short of changing source
and recompiling -- it always attempts to raise the priority to the
realtime class.  However, it will gracefully fall back to high
priority class if the user account under which it is run is not
granted the SeIncreaseBasePriorityPrivilege.  From a command prompt,

C:\windows\system32>showpriv SeIncreaseBasePriorityPrivilege
2 account(s) with the SeIncreaseBasePriorityPrivilege user right:
All accounts enumerated

dlh-7551 is the machine name in my case.  The ntp user is created by
the Meinberg installer for ntpd using default options.  If you remove
SeIncreaseBasePriorityPrivilege, you can force ntpd to no higher than
high priority class.  That can be done using secpol.msc, navigating
the tree to Local Policies\User Rights Assignment, then
double-clicking on "Increase scheduling priority" to edit the list of
user accounts granted that privilege.

I doubt it will improve ntpd's performance, but if you find it does,
please create an account and file a bug report at http://bugs.ntp.org/

Dave Hart

More information about the questions mailing list