On Tue, Sep 9, 2008 at 6:17 PM, David Boyes <[EMAIL PROTECTED]> wrote: > Because ntpd wakes up periodically to check to see if it needs to do > anything, and causes the virtual machine to get dispatched, which causes > CP to have to get it actually ready to run, causing lots of fuss, all to > decide there is nothing to do, so ntpd can go back to sleep. 8-)
David got me wondering just how often ntpd wakes up. I had assumed that it would sleep until the next time it wanted to send a packet out, but I was wrong. Horribly wrong! It actually wakes up at least once per minute, perhaps more. It seems to be setting an alarm every 30-seconds. I think Rob's presentation (http://www.rvdheij.nl/Presentations/2005-L76.pdf) has the best advice: set your z/VM TOD clock accurately at POR, and let the Linux systems use it. If you're really concerned about accuracy, run "ntpd -qx" from cron at staggered times so all your guests don't do it at once. So what's wrong with ntpd? I wanted to see how often Linux scheduled that daemon to run, but didn't know of any tool that would accurately tell me when a process was given some CPU time. So I wrote a little program that tracks the process statistics and tells me how many jiffies get used during some time interval. This is an approximation to what I really want to know, because it doesn't tell me how many times a process wakes up during that interval, just that it woke up at least once. When I started it up, I was surprised to see that ntpd was waking up frequently. But I had just started it a few minutes before (I don't normally run it on my Linux instances), so perhaps it hadn't settled down yet. So I left it running overnight. This morning, it's still waking up far too often. Here's some output. The fields are the time, total jiffies, system jiffies, user jiffies, and program name. The sampling interval is 5 seconds, but it only outputs a line if the total jiffies for the interval is non-zero: 10:17:05 1 0 1 (ntpd) 10:17:20 1 1 0 (ntpd) 10:18:55 1 1 0 (ntpd) 10:19:50 1 0 1 (ntpd) 10:20:35 1 1 0 (ntpd) 10:22:06 1 1 0 (ntpd) 10:22:41 1 0 1 (ntpd) 10:23:41 1 1 0 (ntpd) For comparison, here's what cron did over a far longer period: 09:30:04 11 5 6 (cron) 09:41:05 1 1 0 (cron) 09:45:05 10 5 5 (cron) 10:00:02 10 4 6 (cron) 10:15:03 11 5 6 (cron) 10:30:05 10 5 5 (cron) This is on SLES 10, with xntp-4.2.0a-70.4. So ntpd isn't doing much, but it is waking up very often. I didn't see any 5-second interval where it used more than two jiffies, which isn't surprising because it doesn't have much to do. I think most of the time it's just adjusting some counters and going back to sleep. Does anyone know of a Linux tool that would give more accurate information about process wake-ups? It would be nice to be able to profile Linux daemons like this and see which ones play nice in a VM environment, because ntpd sure doesn't! - MacK. ----- Edmund R. MacKenty Software Architect Rocket Software, Inc. Newton, MA USA ---------------------------------------------------------------------- For LINUX-390 subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit http://www.marist.edu/htbin/wlvindex?LINUX-390