hi, I want to find the average percentage CPU utilisation in C.can any one help me out. regards
On 27/03/05 15:59 +0530, Sajid ali Baig wrote:
hi, I want to find the average percentage CPU utilisation in C.can any one help me out.
Depending on the OS, you have to do different things. In Linux, look at /proc, in particular, /proc/loadavg. man proc is your friend.
Devdas Bhagat
hi , when i am posting a query on linux user group it obviously means i am looking for a linux solution. /proc/loadavg does not give % CPU utilization it gives avg number of processes in the run queue. and let me add one more question to it. Whwn can one say that a CPU is overloaded.i mean running one more process would be very difficult . regards
Sometime Today, Sajid ali Baig assembled some asciibets to say:
when i am posting a query on linux user group it obviously means i am looking for a linux solution.
Not really. Some of the members of this group also use other unixes and we allow discussions for any Free unix. This includes linux based systems, hurd based systems, Free variants of BSD based systems, open solaris and any other free/open unix like operating system.
Whwn can one say that a CPU is overloaded.i mean running one more process would be very difficult .
The CPU technically isn't overloaded, however, there comes a time when total context switching time becomes significant compared to process execution time. I don't have any experience in this to give you relevant figures however.
Philip
On 28/03/05 10:44 +0530, Sajid ali Baig wrote:
hi , when i am posting a query on linux user group it obviously means i am looking for a linux solution. /proc/loadavg does not give % CPU utilization it gives avg number of processes in the run queue. and let me add one more question to it. Whwn can one say that a CPU is overloaded.i mean running one more process would be very difficult .
Perhaps /proc/stat then?
man 5 proc. A CPU is overloaded when the utilisation of a CPU is 100%.
Devdas Bhagat
On Mon, 28 Mar 2005 10:44:14 +0530, Sajid ali Baig sajidalibaig@gmail.com wrote:
/proc/loadavg does not give % CPU utilization it gives avg number of processes in the run queue.
try 'top' : it gives proc activity in real time.
Whwn can one say that a CPU is overloaded.i mean running one more process would be very difficult .
Just a passing thought : if your machine has been fork-bombed no process will run and m/c comes to a grindfing halt. I am not sure if that is what you are looking for, so *dont* try this. It is applicable to all variants of Linux and is possible only if the user has access to the m/c. _svaksh_
On Monday 28 Mar 2005 10:44 am, Sajid ali Baig wrote:
Whwn can one say that a CPU is overloaded.i mean running one more process would be very difficult .
Theoretically I think when the system throughput starts dropping due to unavailability of processing, it can be said to be overloaded.
On Sunday 27 Mar 2005 10:29 am, Sajid ali Baig wrote:
hi,
Hope this may help. Have a look at /proc/stat Find user(Tu),nice(Tn),sys(Ts) and ideal(Ti) usage in jiffies for some small time duration(T in jiffies). %usage Total = (Tu+Tn+Ts+Ti)*100 / T Same should be true for each process /proc/PID/stat which ps uses.
Warm Regards
Balwinder Singh
Trusted Machines http://www.trustedmachines.com
hi, I want to find the average percentage CPU utilisation in C.can any one help me out. regards