LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-11-2020, 10:59 AM   #1
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Rep: Reputation: 103Reputation: 103
different measurements between (h)top and ps aux


Hi,

I'm having trouble understanding how ps aux and htop take measurements, or rather ps aux, because in this case I trust htop. I've running a container with a cpu limit of 0,2 (so 20%) and then started a loop process which runs over and over.
htop shows me constantly:
Code:
26576 root       20   0 90108 11620  5356 S 20.6  0.3  2:25.98 python3
Wheras ps aux shows:
Code:
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     26576 16.4  0.2  90108 11620 pts/0    Ssl+ 17:42   2:28 python3
(of course I've run ps aux over and over just to make sure)
I don't understand where the difference lies.

It seems though that measurement of ps aux increases slightly by 0.1 every 30 seconds, maybe?
Is there some kind of delay? I don't really get it and I find it very misleading.

Now it's reached 16.8
 
Old 05-11-2020, 11:09 AM   #2
vincix
Senior Member
 
Registered: Feb 2011
Distribution: Ubuntu, Centos
Posts: 1,240

Original Poster
Rep: Reputation: 103Reputation: 103
Never mind, I should have searched on the internet first - the cpu percentage shown by ps refers to the whole lifetime of the process.
 
Old 05-11-2020, 08:11 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,142

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
So would the first iteration of htop.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loudspeaker measurements - waterfall graphs 1tommysk Linux - Newbie 2 02-05-2010 05:28 AM
ps aux and top graziano1968 Linux - Server 1 11-30-2007 09:58 AM
Obtaining periodic AP receive signal strength measurements wood@addanc Linux - Wireless Networking 2 06-24-2007 11:43 AM
qos parameter measurements halldor Linux - Networking 0 04-18-2004 11:05 AM
security measurements dominant Linux - Security 1 01-29-2004 09:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration