[ntp:questions] how to change the runtime priority - AND crazy psycho GPS

Ron Frazier (NTP) timekeepingntplist at c3energy.com
Sun Feb 5 01:54:17 UTC 2012

See comments below.
I changed the subject line slightly since I'm going to add to the 
original topic.

On 2/3/2012 1:05 PM, Dave Hart wrote:
> 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,
> try:
> C:\windows\system32>showpriv SeIncreaseBasePriorityPrivilege
> 2 account(s) with the SeIncreaseBasePriorityPrivilege user right:
> BUILTIN\Administrators
> dlh-7551\ntp
> 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/
> Cheers,
> Dave Hart
Hi Dave,

Thanks for the note.  I wasn't quite sure how to address my reply.  When 
I hit reply, it just put your name at the top, but it looked like you 
had sent your reply to me to the questions list as well, so I decided to 
send this to both addresses.

I thought there was a way to override the application's built in 
priority selection, other than using task manager.  I may have to try 
the method you mentioned if my testing indicates it's necessary.  Here's 
why I think it may be a problem.  Take a look at the following loopstats 


Note that is has a number of discrepancies and jaggedy areas and 
discontinuities along the time axis..  It also has a maximum excursion 
of around 30 ms offset.

Now look at this file:


This is representative of what I've been getting from my USB GlobalSat 
BU-353 when I have it set on Above Normal priority after switching it 
with the task manager away from real time priority.  Note that the 
scales are different if you chart it.  There are no significant 
discontinuities and maximum excursions are in the 15 ms range.  For a 
USB only device with no PPS, I think this is a pretty good chart.  It 
seems to me, this is performing better.  I'll admit I have to do more 
testing to confirm any patterns.

Actually, I've diverted my attention to troubleshooting a worse 
problem.  Once I figure that out, I plan to get back to the priority 
issue.  After about 3 days of rock solid operation similar to the above 
chart, my GPS suddenly goes phycho on me.  Offsets go wild and get up 
into the 100 ms range.  See the next file:


As you can see, this continued for about 12 hours until I got tired of 
it.  I stopped the ntpd service.  Unplugged the GPS.  Waited 30 
seconds.  Then plugged it in again and restarted the ntpd service.  Now 
I'm back to a little over a full day of rock solid operation again.  I'm 
waiting to see if it freaks out 2 days from now.  If anyone can help me 
determine what's up with that, I'd be very grateful.  I have verified 
that the TWO sets of firmware in the device (one for GlobalSat and one 
for the SIRF III chipset) are up to date as well as the USB - serial 
driver in my PC.  I suspect a design flaw in the GPS firmware, perhaps a 
memory leak, or maybe a similar flaw in the Prolific USB - serial 
driver.  However, I'm just speculating.

Here's my ntp.conf file:


By the way, can you do attachments on this NTP Questions list.  I think 
I read somewhere that you cannot, which is why I'm using dropbox.  
However, I may have to delete these files after a while..

Any help with these issues is greatly appreciated.




(PS - If you email me and don't get a quick response, don't be concerned.
I get about 300 emails per day from alternate energy mailing lists and
such.  I don't always see new messages very quickly.  If you need a
reply and have not heard from me in 1 - 2 weeks, send your message again.)

Ron Frazier
timekeepingdude AT c3energy.com

More information about the questions mailing list