LinuxQuestions.org
Review your favorite Linux distribution.
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 02-01-2016, 07:59 AM   #1
sumncguy
Member
 
Registered: Jun 2013
Posts: 76

Rep: Reputation: Disabled
Newbi Sys Admin Under Training - Sar and Top not matching.


I guess I dont have a good understand of whats going on.

We have a miss behaving process. I figured Id use this problem as a learning opportunity while the real admins chase it down.

Tops partial output is .. .
Quote:
Tasks: 270 total, 1 running, 269 sleeping, 0 stopped, 0 zombie
Cpu(s): 16.8%us, 1.0%sy, 0.0%ni, 82.2%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 16333096k total, 6872788k used, 9460308k free, 162256k buffers
Swap: 16482300k total, 51260k used, 16431040k free, 1893972k cached

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
15134 xxxx 20 0 14.8g 1.6g 14m S 202.7 10.1 410:15.06 bad proccess
19862 xxxx 20 0 15164 1360 920 R 1.7 0.0 0:00.05 top
1 root 20 0 19232 1080 900 S 0.7 0.0 3:00.59 init
31989 root 20 0 684m 5876 2872 S 0.7 0.0 0:21.05 jinga
14995 xxxx 20 0 5720m 796m 5980 S 0.3 5.0 12:26.59 mysqld
15713 xxxxx 20 0 7180m 599m 11m S 0.3 3.8 1:07.68 java
Quote:
-bash-4.1$ sar -u 1 3
Linux 2.6.32-573.3.1.el6.x86_64 (hostname) 02/01/2016 _x86_64_ (12 CPU)

01:52:15 PM CPU %user %nice %system %iowait %steal %idle
01:52:16 PM all 25.35 0.00 3.67 0.08 0.00 70.89
01:52:17 PM all 25.54 0.00 7.20 0.00 0.00 67.25
01:52:18 PM all 25.08 0.00 0.50 0.00 0.00 74.42
Average: all 25.33 0.00 3.79 0.03 0.00 70.86
So my question is .. if top shows the cpu at 200% should I see similar numbers in sar ??
 
Old 02-01-2016, 12:05 PM   #2
tlowk
Member
 
Registered: Nov 2003
Location: Belgium
Distribution: Slackware
Posts: 184

Rep: Reputation: 36
You can type '1' in top and see different CPU instead of a combine one.

Maybe top show a percentage for 1 core (if you have 4 cores it could show even 400%) when you do not split the cores with the 1 key
and sar might use a percentage relative to the total so it could show 100% instead.

I'm not sure it is entirely correct, but my short experiments suggests something like this.
 
Old 02-01-2016, 12:14 PM   #3
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Contents removed, misleading.

Last edited by Emerson; 02-01-2016 at 12:15 PM.
 
Old 02-01-2016, 05:33 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
As suggested, top is non-normalised, so for multi-threaded processes, may report (significantly) above 100.
The duration the average usage is calculated over is also markedly diferent for the two tools.
 
Old 02-02-2016, 09:30 PM   #5
MrTux
Member
 
Registered: Dec 2015
Posts: 131

Rep: Reputation: Disabled
I believe it has to do with the multiple cores.


check /proc/cpuinfo instead for accuracy
 
  


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
LXer: Top 5: Open source projects of the year, sys admin tools, and more LXer Syndicated Linux News 0 12-18-2015 05:51 PM
Network statistics in sar for VLANs not matching lpwevers Linux - Networking 2 10-10-2014 04:30 AM
SAR and TOP yuanjunliang Linux - Server 1 02-18-2010 02:12 PM
sys admin vs network admin sulekha Linux - General 5 01-11-2009 05:03 AM

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

All times are GMT -5. The time now is 11:32 PM.

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