ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi
well i want to know what factors are included in the dynamic calculation of loadavg in /proc file system. factors like cpu,memory,disk usage, i/o etc.
suppose i have a web server running on the linux sytem. does loadavg gives the statistics including the performance of the server?
also suppose i have current loadvg of 0.20 (considering only 1 minute usage)and after some time when i check it again it goes up to say 1.5
what can i infer from that .
also what is the optimum value that leads me to conclude that yeah the system is really overloaded.
If i have a linux system running only a web server and no other daemons , if the loadavg shows that the system is overloaded, can i conclude that the overloaded system is due to overloading of web server due to large number of requests?
any suggestions will be appreciated.
if someone can suggest me a man page for loadavg which is more descriptive , i would be very thankful
"The first three fields in this file are load average figures giving the number of jobs in the run queue (state R) or waiting for disk I/O (state D) averaged over 1, 5, and 15 minutes. They are the same as the load average numbers given by uptime(1) and other programs. The fourth field consists of two numbers separated by a slash (/). The first of these is the number of currently executing kernel scheduling entities (processes, threads); this will be less than or equal to the number of CPUs. The value after the slash is the number of kernel scheduling entities that currently exist on the system. The fifth field is the PID of the process that was most recently created on the system."
I have been chasing after how these figures are computed for a while myself. All man proc has to say about the issue is what I posted here. Even reading the kernel source which contains the source for get_loadavg() didn't help much. All I can gleam is that it uses clock ticks (jiffies) to compute it, and these vary by machine (some are 100HZ, and some 1000HZ...).
Have a look at /usr/src/kernel/timer.c lines 550 - 950, and see if you can make more sense of it than me
is there any why by which we can calculate it
look i am getting load avg as
0.06 0.60 0.43 3/94 8650
in this 3/94 is not possible because i have only one cpu
so 3 may be taken as thread
am i right
tell me please if someone has runnig program bout it
There are complete bibles written about capacity and performance management on UNIX, so I'm not going to deep into the subject.
To answer your question about which factors make up the system load : the average number of runnable processes during a fixed period of time; that is, processes actually fighting for CPU time, not running processes. And maybe processes waiting for IO are also counted with that, but don't know for sure.
If you want a more total picture of your system's performance, you'd better use sar or vmstat.
[i]
in this 3/94 is not possible because i have only one cpu
[/B]
Note that hyperthreading makes your machine look like a dual CPU machine...
And yes, the 3 could be a running thread, or some other process which is fighting for CPU time. If you want to know how a process gets into the runqueue, you should spend some time studying the scheduler to understand the concepts of time-share computing
but i have gone through scheduling and all these
but i am really worried about how the real things are done
although i have got some answers form vmstat but not clear
can u suggest how i can access the time slice of the linux
what about kernal module programming how it is done.....if someone will give me something on this topic i will be highly gateful to him or her
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.