Ubuntu Server: Considering Kernel Configuration - Page 2

By Carla Schroder | Posted Nov 12, 2007
Page 2 of 2   |  Back to Page 1
Print ArticleEmail Article
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

Preemption

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.

Memory

The 32-bit server kernel supports up to 64 GB of memory; the desktop kernel, a mere 4 GB (CONFIG_HIGHMEM64G=y, CONFIG_HIGHMEM4G=y). You'll only see these options in 32-bit kernels because the 32-bit address space is big enough to support only 4 GB without trickery. Or by using the Intel PAE (Physical Address Extension) mode, if you want to get technical. Linux supports PAE, and you also need PAE support in your CPU. Anything newer than a Pentium Pro or AMD K6-3 should be fine. On a 64-bit system you won't see any memory options because it doesn't need hacks to overcome a lack of memory addressing space; you should be fine until your needs exceed 16 exabytes of RAM.

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.

Resources

Comment and Contribute
(Maximum characters: 1200). You have
characters left.
Get the Latest Scoop with Enterprise Networking Planet Newsletter