Red Hat and related distro's (like CentOS) use 1000 timer interrupts per second, per CPU core or thread (this is called the "HZ value" inside the kernel). Because this causes a lot of extra work in case of virtualization, and caused (past tense since RHEL 5.4!) problems with timekeeping, the "divider" kernel parameter has been introduced. For example, by booting with "divider=10", the kernel uses 100 timer interrupts instead of 1000, and "divider=25" means 40 timer interrupts per second.
I did a little test today to see what difference that makes when running CentOS5.4 on vSphere. Tests were done with the current 2.6.18-164.11.1.el5 x86_64 kernel in a single vCPU VM. These are the results from my test environment:
On your own machines, you can easily check:
Summary: before RHEL 5.4, divider=10 was recommended for timer accuracy. This is no longer true, but as I've shown, it still helps lowering the timer interrupt overhead. Don't forget that the ideal divider setting depends on your application: thread wake-up delays can occur in high divider scenario's, and responsiveness could potentially suffer because of that.
I did a little test today to see what difference that makes when running CentOS5.4 on vSphere. Tests were done with the current 2.6.18-164.11.1.el5 x86_64 kernel in a single vCPU VM. These are the results from my test environment:
- standard settings: HZ=1000: 60 MHz cycles used when idle.
- divider=2: HZ=500: 36 MHz cycles used when idle.
- divider=5: HZ=200: 25 MHz cycles used when idle.
- divider=10: HZ=100: 20 MHz cycles used when idle.
- divider=25: HZ=40: around 10-15 MHz cycles used when idle (results slightly variable, also for higher dividers)
- a nohz "tickless" kernel (I used 2.6.24.7-146.ay, not currently available in RHEL/CentOS by default) used 70 MHz cycles when idle in my test environment. This is a surprise, and I don't have a good explanation (yet) !
On your own machines, you can easily check:
- the current divider setting by looking at the currently active kernel parameters: cat /proc/cmdline . No divider parameter means divider=1, the default.
- the measured timer interrupt rate (close approximation of HZ value): dstat -i -I timer
Summary: before RHEL 5.4, divider=10 was recommended for timer accuracy. This is no longer true, but as I've shown, it still helps lowering the timer interrupt overhead. Don't forget that the ideal divider setting depends on your application: thread wake-up delays can occur in high divider scenario's, and responsiveness could potentially suffer because of that.
Comments