Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
Hello, is there any way I could count CPU load average? I don't want to use system load average from /proc/loadavg since it also contain uninterruptible processes, I just want to count average number of runnables.
Load average is an exponential moving average; how do you propose to achieve that ?. The code is of course in the source tree.
For the runnable count look at /proc/stat.
"The presence of the experimenter will alter the experiment." Your process will be an excessively-busy, CPU-bound process according to your own measure.
Also, this statistic is basically meaningless. The pool of "runnable" processes changes from one microsecond to the next, and it is good(!) for that list to be as full as possible and for the CPU(s) to be as near to "100% utilization" as possible, anytime there is any work to do.
Load average is an exponential moving average; how do you propose to achieve that ?. The code is of course in the source tree.
For the runnable count look at /proc/stat.
No idea how I would achieve that... You can see instantaneous runnables value in /proc/stat but what is purpose of that? I mean if you don't average it than you might see 100 runnables in one second and 0 in second I don't know what you should make of it.
Quote:
"The presence of the experimenter will alter the experiment." Your process will be an excessively-busy, CPU-bound process according to your own measure.
Also, this statistic is basically meaningless. The pool of "runnable" processes changes from one microsecond to the next, and it is good(!) for that list to be as full as possible and for the CPU(s) to be as near to "100% utilization" as possible, anytime there is any work to do.
What if I want to start new heavy program on this machine, if it's already at 100% all the time I certainly don't want to run more programs here which will overload this machine.
"100% CPU utilization" will not "overload the machine."
Also, observations made of the program when it is experiencing no competition for resources will over-state its actual resource requirements because Linux is designed to be "lazy."
Simply do runtime measurements, e.g. with the time command, under various surrounding load conditions.
"100% CPU utilization" will not "overload the machine."
Also, observations made of the program when it is experiencing no competition for resources will over-state its actual resource requirements because Linux is designed to be "lazy."
Simply do runtime measurements, e.g. with the time command, under various surrounding load conditions.
By overload I mean that machine will take longer to do same job. e.g machine is working on 100% all the time, now if you add 100 more programs than cpu utilization will still be 100% however every program would spend much time waiting for other programs therefor everything will be slowed down. So when you have machine with 100% utilization everything might work fine but you don't want to add more and more job to that machine. Initially I wasn't talking about utilization, instead I was talking about average number of runnable programs, which means how many programs are in cpu queue which I believe is best measurement for how good cpu performs since if this number is always more than the number of you cpus you know that some programs spend time waiting for other programs to finish, therefor it works slower.
Once again, the content of the run-list changes every microsecond. Its "average length" is not useful. It won't correlate to anything at all.
All running programs are in competition for the same basic resources: memory, CPU time, and I/O bandwidth. (Memory generates some amount of I/O traffic due to demand paging.)
The operating system is "lazy," never doing more than it has to. Thus, you must create some amount of "stress."
What you're really interested in is how long a particular activity takes to complete, under different realistic load conditions. The classic performance curve is elbow-shaped, gradually rising until it abruptly "hits the wall." (Splat!) I suggest that you, literally, conduct an experiment with different load mixes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.