If you have ever used a Linux system, or been a system administrator you would have come across the term, load average. Whenever there happens to be a performance issue with the system, you commonly hear the question, what is the load average on the server?
In this article, let's break down the questions into a couple of parts:
- What is load average?
- How do we calculate if we have sufficient load?
- How do we determine if the system is overloaded?
What is load average
Load Average is technically the system load calculated as the average of the sum of running and waiting for process threads. It is defined over a period of time of 1, 5 and 15-minute intervals.The load average is generally observed from common commands like top and uptime
For example:
[root@centos7 ~]# uptimeSo this section tells that the 1 5 and 15-minute interval for load average is 0.05, 0.15 and 0.20 respectively.
08:32:53 up 47 days, 21:09, 1 user, load average: 0.05, 0.15, 0.20
To understand these values, let's take an example to cover if we have sufficient load and if the system is overloaded:
Consider the system you are running is a single-core processor, which is equivalent to a one-lane bridge. If there are no cars on the bridge, then it is completely free of load and the load average is related to 0. If there is a car going on the bridge, then the lane is occupied and the bridge is at its capacity and the load average relates now to 1. Now, what means next is that if any additional cars come on the bridge the load is exceeded than what the bridge can handle and the system is now overloaded when the load average jumps to 2.
The same concept is extrapolated when there are multiple cores available, essentially expanding the lanes on the bridge for reference.
What about Multiprocessors and Multicore system
If you have a single processor with 4 cores for example, then it's a single processor quad-core system also called a multicore system
If you have multiple processors with one or more cores each then it is essentially called a multiprocessor system.
So for a single-core system the maximum range of load average is spread between 0 to 1, for dual-core, 0 to 2, quad-core 0 to 4 and so on.
On top of this, you can have a system with hyperthreading enabled. Under hyperthreading, a single physical CPU core appears as two logical CPUs core to an operating system. Since a single-core processor can process only one task at a time, hyperthreading was introduced to allow multiple threads to be executed within the same core.
You can find your CPU / Core count and hyperthreading details from the lscpu command
[root@centos7 ~]# lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel
0 comments:
Post a Comment