Follow the Australian Telecommunications scene NEWSLETTER- FREE TRIAL
The Linux distillery
Bringing the world of Linux to you, David cuts through the tech and shows you how it works and how to use it, in terms that apply to any distro. RSS
Just what makes Linux tick E-mail
by David M Williams   
Thursday, 21 February 2008
Each time the clock ticks the scheduler has an opportunity to switch out the running process and bring in another. So, increasing the frequency of interrupts will decrease the length of a jiffy and mean the running process is changed more often. In a real-time system, such as a hospital or military system, every millisecond can be crucial.

In reality, the scheduler takes up time itself. So, there actually is a trade off; you cannot increase the interrupt frequency to any value as high as you like because you will eventually hit a peak where handling the interrupts and scheduling takes up as much, or more time, than executing processes does. At this point everyone loses and the CPU becomes less efficient.

In fact, a higher tick frequency can also result in higher CPU usage in general. If your computer is a server-based system with dual processors and backup power supplies then this is not an issue. If, however, your Linux system is running on a laptop that’s often disconnected from power, then you will be adversely affected. This is also true of embedded systems with slow CPUs.

As of kernel 2.6.14 the clock tick frequency has become configurable on most architectures. The default value for 32-bit ‘386-based systems is now 250Hz – ie 250 ticks per second – but options are given for 100, 250 and 1,000 Hz when the kernel is being built.

A slow processor or low power system would opt for a smaller value, whereas a powerful machine or one with multimedia or critical real-time application requirements would benefit from a higher value. This value can only be set when the kernel is being built; it cannot be changed on any Linux system without rebuilding the kernel.

To check what the value of HZ is on your system execute the command

cat /boot/config-`uname -r` | grep '^CONFIG_HZ='

Does this meet your needs? For most people the defaults should be fine. However, if you are on the extremes you can tweak your system to either consume less power or to react more quickly by adjusting this value. This isn’t for everyone; you need to take care when rebuilding the Linux kernel. However, on the other hand, the Linux kernel which comes with every distro is largely generic so it can suit the broadest range of computers. By rebuilding your kernel you can also take advantage of optimisations or the removal of unnecessary drivers to eke out greater performance.

Be sure to check out the man pages for the time and strace commands. Being able to monitor the time your applications take is tremendously useful for understanding your system and for debugging slow executing code.

See you in a jiffy next Monday where we’ll talk about what Linux has in common with a B-grade horror flick.
Powered By Joomla Tags

Please enable JavaScript in your browser to post your comment!



 
< Next story in category   Previous story in the category >
iTWire user statistics Visitors last 30 days
694,279
Subscribers 15,210
#1 independent technology news advertise here
  •   *  
  • Search
  • AdvSeach
  • Login
  • Events
  • FreeStuff

- Advertisement -

Featured Whitepapers

Follow iTWire on Twitter

About iTWire

iTWire is all about technology news, information, jobs and community for the IT and telecommunications industry professional. Subscribe to our free ICT daily newsletter