The three load-average values in the first line of top output are the 1-minute, 5-minute and 15-minute average. (These values also are displayed by other commands, such as uptime, not only top.) That means, reading from left to right, one can examine the aging trend and/or duration of the particular system state. The state in question is CPU load—not to be confused with CPU percentage. In fact, it is precisely the CPU load that is measured, because load averages do not include any processes or threads waiting on I/O, networking, databases or anything else not demanding the CPU. It narrowly focuses on what is actively demanding CPU time. This differs greatly from the CPU percentage. The CPU percentage is the amount of a time interval (that is, the sampling interval) that the system’s processes were found to be active on the CPU. If top reports that your program is taking 45% CPU, 45% of the samples taken by top found your process active on the CPU. The rest of the time your application was in a wait. (It is important to remember that a CPU is a discrete state machine. It really can be at only 100%, executing an instruction, or at 0%, waiting for something to do. There is no such thing as using 45% of a CPU. The CPU percentage is a function of time.) However, it is likely that your application’s rest periods include waiting to be dispatched on a CPU and not on external devices. That part of the wait percentage is then very relevant to understanding your overall CPU usage pattern.
Month: May 2014
Trim last 3 characters of a line using the bash shell.
Kernel – Install and Compile in Debian Linux
To get started, we are going to need some packages, namely fakeroot and kernel-package:
root# apt-get install fakeroot kernel-package
Now, lets take a latest source tarball from www.kernel.org or you may use following wget command to download it.
root# wget -c https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.58.tar.xz
Now, let’s unpack the archive.
root# tar -xvJf linux-3.2.58.tar.xz
After, extracting, a new kernel source directory will be created.
root# cd linux-3.2.58
Now, we will want to configure the kernel. It is best to start with a configuration that you are currently using and work from there. To do this, we will copy the current configuration from the /boot directory to the current working directory and save it as .config.
root# cp /boot/config-3.2.0-4-amd64 ./.config
Now we can configure the kernel:
root# make menuconfig
Once that is done, it is time to clean the source tree.
root# make-kpkg clean
Finally, it’s time to build the kernel package.
root# export CONCURRENCY_LEVEL=3
root# fakeroot make-kpkg --append-to-version "-customkernelname" --revision "1" --initrd kernel_image kernel_headers