Ubuntu Server: Considering Kernel Configuration - Page 2
The server kernel has kernel preemption turned off (CONFIG_PREEMPT_NONE=y), while the desktop kernel has it enabled (CONFIG_PREEMPT_BKL=y, CONFIG_PREEMPT_VOLUNTARY=y). Preemption works along with scheduling to fine-tune performance, efficiency, and responsiveness. In non-preemptive kernels, kernel code runs until completion; the scheduler can't touch it until it's finished. But the Linux kernel allows tasks to be interrupted at nearly any point (but not when it is unsafe, which is a whole huge fascinating topic all by itself), so that tasks of lesser-priority can jump to the head of the line.
This is appropriate for desktop systems because users typically have several things going at once: writing documents, playing music, Web surfing, downloading, and so on. Users don't care how responsive background applications are, but only the ones they're actively using; so if loading a Web page takes a little longer while the user is writing an email, it's an acceptable trade-off. Overall efficiency and performance are actually reduced, but not in a way that annoys the user.
On servers you want to minimize any and all performance hits, so turning off preemption is usually the best practice.
Ticks and HZ
Both kernels support on-demand interrupt timers (CONFIG_NO_HZ=y), or the so-called "tickless" option. This means that during periods of no activity, the system goes into a truly idle state, which is supposed to save on power and cooling.
The server kernel is set to a timer interrupt rate of 100 Hz (CONFIG_HZ=100, CONFIG_HZ_100=y), which means it accepts 100 interrupts per second. Another way to think of this is the kernel looks up and peers around 100 times per second for something to do. The desktop kernel is set to 250 Hz; lower numbers = lower overhead and higher latency, higher numbers = higher overhead and lower latency. Higher numbers generally mean the system feels more responsive, at the price of higher CPU usage. Some processes require more interrupts; for example, video processing and VoIP servers need 1000 Hz. If you need to change the Hz value it requires a kernel re-compile.
Come back next week to complete our kernel comparisons, and to finish our deep dive into the guts of Ubuntu Server.