Beruflich Dokumente
Kultur Dokumente
https://linuxaria.com/howto/understanding-the-t...
Linuxaria
Search
Articles
Guides
Interview
Pills
Reviews
Information
Links
sponsored links
Language:
Aug
28
2012
Guides
Share
Share
Add comments
Like 0
Tweet
Linuxaria
3,427 likes
top
Article by AlexioBash published
Like Page
Share
use and optimize your OS. On ArchLinux or better on GNU/Linux in general the top
command can help us, this is a very useful system monitor that is really easy to use,
and that can also allows us to understand why our OS suffers and which process
use most resources. The command to be run on the terminal is:
Sponsor
$ top
1 Row top
Accept
Read
More
1 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
2 Row task
Follow Me
3 Row cpu
Subscribe
The third line indicates how the cpu is used. If you sum up all the percentages the
total will be 100% of the cpu. Lets see what these values indicate in order:
Percentage of the CPU for user processes (0.3%us)
Percentage of the CPU for system processes (0.0%sy)
Percentage of the CPU processes with priority upgrade nice (0.0%ni)
Popular posts
Storing large binary files in git
repositories
Subscribe by Email
The fourth and fifth rows respectively indicate the use of physical memory (RAM)
and swap. In this order: Total memory in use, free, buffers cached. On this topic you
can also read the following article
My scoop.it feed
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
2 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
currently in use. Lets see what information we can get in the different columns:
Consultant
Fluxday: A no-fuss open source
productivity tracker
Conclusions
Now that we have seen in detail all the information that the command top returns, it
will be easier to understand the reason of excessive load and/or the slowing of the
system.
A good alternative to TOP is HTOP , an evolution of top with features really
amazing.
Popular Posts:
Storing large binary files in git repositories
Share
Share
Like 0
Tweet
1.
imo says:
Wednesday August 29th, 2012 at 03:56 PM
2.
I use top, but more often use htop, which is like top on steriods. Its likely in most
repos for any distro.
Reply
3. Duncan says:
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
3 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
OK, so you say what each line means, but at that level, the information is pretty
much there for the reading in the labels or the top manpage, anyway.
The sort of questions I remember asking myself when I first started were things like:
OK, we have Load. I know what average means and I /think/ I know what load
means, and it goes up as the system gets busier, and down as the system is less
busy, but what does 0.02 (the load 1 minute average in the example above)
actually MEAN? It OBVIOUSLY cant be percent CPU load, because thats reported
too, and its WAYY too low for that!
I KNOW its load average, because I can READ the labels. And its easy enough to
find that the three numbers are 1/5/15 minute averages. What I did NOT know was
what load average was.
FWIW, if I understand correctly but not getting /too/ technical. load, on Linux/Unix,
refers the the number of threads that would be ready to run if given CPU time at that
instant, as opposed to those that couldnt run, because theyre waiting for some
event. For instance, as I type this, firefox is spending a lot of time waiting for me to
type the next letter in the textbox, so its mostly idle and not runnable, thus not
contributing to load very much. The instantaneous load can be seen on tops task
line as running (note that at the moment the measurement is taken, top itself is
running, so top should always report at least one running, more if anything else is
running at that instant as well, also note that running actually means runnable,
its quite possible to have a running load well above the actual number of CPU
cores available on your system, so its NOT reporting actually RUNNING, but
runnable, despite the label). For those who like a file interface, its also available
as the procs_running line near the bottom of /proc/stats. Also see /proc/loadavg
for the averages, a runnable/total threads ratio as the 4th number, and I dont know
what the 5th is.
Load average indicates how many threads were runnable on average during the
time in question, and a one-minute load average of 1.00, under ideal conditions,
would mean that exactly one cpu core was running at 100% during the last full
minute, which on a single-core system would be 100% CPU utilization (ideally). Of
course in actuality, a 1.00 one minute load average isnt likely to keep a single CPU
core at 100% usage for the full minute, because for a small fraction of that minute
there was likely a 2.0 instantaneous load as the average was updated and as other
system tasks did their thing, which means there was also a fraction of time when
nothing was ready to run and that core was idle. So to get close to 100% CPU
utilization on a single core in practice takes a bit more, say a 1.5 load average.
And of course on a modern multi-core, the load necessary to fully utilize all cores
goes up along with the number of cores. On my 6-core bulldozer, for instance, a
load average of 6.00 would be the (ideal/theoretical) minimum required to keep the
CPU fully occupied, but in practice, a load average of 9 or so would be more
efficient at it. But get a load average more than about double your number of cores
(and of course for CPUs that have it, theres hyperthreading to figure in as well,
noting that each hyperthread is counted like a physical core would be, tho theres
differences), and your CPU is probably a bottleneck (altho it can be a storage
bottleneck as well, since i/o-wait is counted as load). Additionally, the higher the
load average goes, the more real CPU cycles the kernel takes to manage
scheduling, so while the kernel can /manage/ a load of several hundred per core as
long as memory and other resources dont run out, its spending a lot of time
switching tasks in and out instead of actually doing them, and is therefore going to
take longer in wall-time to complete those tasks, than it would have if load were
limited to say 3 per core. (With tasks like kernel builds, its possible to tell the
system how many jobs to run in parallel. A kernel build is a really nice example
here, as if allowed to schedule unlimited jobs and given enough memory, it can
paralllel several hundred, perhaps over a thousand. I do that here routinely and get
up to about 600, tho it takes my full 16 gig of ram and goes into swap to do so. But
while its fun to watch the runnables climb, even if limited a bit so it doesnt swap
TOO much, letting it schedule say 20 parallel make jobs per core, 120 jobs total on
my 6-core, does take longer in wall time to complete than something more
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
4 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
numbers are, and can make better guesses about the tasks line (tho the zombie
entry needs more explanation). But what about the rest? The title of the article
suggests the reader will /understand/ top when hes done reading it. Hardly! If they
can read labels (and if they couldnt, how could they read this article) and had run
the command before, they barely know more about it whan when they started, let
alone UNDERSTAND it. Now the article needs to be expanded to do pretty much
what I did for load, to nearly every single entry (the uptime, etc, seems pretty self
explanatory). What does user vs system vs nice vs wait vs actually MEAN, for
instance. Whats do nice and priority mean in the Linux scheduling context, and how
do they relate to each other? If the memory line says I have 0 free memory, does
that mean the systems about to crash? (Hint: No, the free in free memory
doesnt mean what one might intuitively /think/ it means, in this context.) We have
the names and the numbers, now we just need to UNDERSTAND them, something
the article title and opening blurb suggest the article will help with, but which it
unfortunately did a rather poor job at. Wheres the understand part? =:^(
Reply
Mike says:
Saturday August 22nd, 2015 at 02:59 AM
Thank you for making this article actually worth reading. I was very
frustrated in the uselessness of it until I got to your comment.
Reply
Steve says:
Friday January 1st, 2016 at 01:11 AM
4.
woo says:
Thursday August 30th, 2012 at 02:50 PM
linuxari says:
Thursday August 30th, 2012 at 03:25 PM
Thanks Woo.
Fixed
Reply
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
5 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
linuxari says:
Sunday December 2nd, 2012 at 07:55 PM
You can find top in every Linux system, while you have to install htop
that IMO give much more information
Reply
6.
euro-space.net says:
Saturday March 29th, 2014 at 04:40 PM
Useful article, helping diagnose server load problems. Using with atop is much
recommended.
Reply
7.
Kenny says:
Monday October 13th, 2014 at 01:56 PM
Thank you.
Reply
8.
PC says:
Wednesday November 19th, 2014 at 12:41 AM
Thank you..
Reply
Leave a Reply
Your Comment
You may use these HTML tags and attributes: <a href="" title=""> <abbr
title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code>
<del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
Name
(required)
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
6 of 7
11/08/16 09:25
https://linuxaria.com/howto/understanding-the-t...
URI
CAPTCHA Code
Submit Comment
2013 Linuxaria
Unported License.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.
Accept
Read
More
7 of 7
11/08/16 09:25