Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
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.
They are both correct.
Understand what you are measuring before even considering comparing the results. Top, when run interactively, displays interval usage - "ps" displays usage since process start.
Potentially vastly different - especially on multi-cores.
They are both correct.
Understand what you are measuring before even considering comparing the results. Top, when run interactively, displays interval usage - "ps" displays usage since process start.
Potentially vastly different - especially on multi-cores.
So , if I want to know the "current" usage , top should be better , am I correct ? But , is it 100% of a single core , right ?
see man top: k: %CPU -- CPU usage
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if 'Irix mode' is Off, top will operate in 'Solaris mode' where a task's cpu usage will be divided by the total number of CPUs. You toggle 'Irix/Solaris' modes with the 'I' interactive command.
see man top: k: %CPU -- CPU usage
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if 'Irix mode' is Off, top will operate in 'Solaris mode' where a task's cpu usage will be divided by the total number of CPUs. You toggle 'Irix/Solaris' modes with the 'I' interactive command.
interesting .. using "I" all the values are divided by 8 which is the number of my cores , thank you.
BTW I was thinking top was doing this automatically .
Last edited by graziano1968; 04-18-2012 at 04:06 AM.
They are both correct.
"ps" displays usage since process start..
I read ps documentation , and truly I can't see that the values are a medium since the process start. However
do you think possible to receive current usage (not from the start) using ps ?
Last edited by graziano1968; 04-18-2012 at 04:20 AM.
man ps see NOTES: CPU usage is currently expressed as the percentage of time spent
running during the entire lifetime of a process. This is not ideal,
and it does not conform to the standards that ps otherwise conforms to.
CPU usage is unlikely to add up to exactly 100%.
but unfortunately it may slightly differ on some linux.
see man top: k: %CPU -- CPU usage
The task's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. In a true SMP environment, if 'Irix mode' is Off, top will operate in 'Solaris mode' where a task's cpu usage will be divided by the total number of CPUs. You toggle 'Irix/Solaris' modes with the 'I' interactive command.
do you think possible to toggle Irix/Solaris when the interactive mode is off
do you think possible to toggle Irix/Solaris when the interactive mode is off
see the man page:
Startup Defaults
The following startup defaults assume no configuration file, thus no user customizations. Even so, items shown with an asterisk ('*') could be overridden through the command-line.
Global_defaults 'A' - Alt display Off (full-screen) * 'd' - Delay time 3.0 seconds 'I' - Irix mode On (no, 'solaris' smp) * 'p' - PID monitoring Off * 's' ...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.