top is a Unix/Linux/BSD program to show what processing are running. It can show the top users of CPU or memory.

learn more… | top users | synonyms

92
votes
2answers
39k views

What exactly do the colors in htop status bars mean?

By default, htop shows colored status bars for processors, memory, and swap. From left to right, the bars are colored green, blue, yellow, and red depending on some thresholds. What does it mean when ...
34
votes
5answers
13k views

How to understand the memory usage and load average in linux server

I am using a linux server which has 128GB of memory and 24 cores. I use top to see how much it is used. Its output is pasted at the end of the post. Here are two questions: (1) I see that each of the ...
22
votes
3answers
16k views

Linux - How can I see what's waiting for disk IO

I have a server that has a really high load. Nothing is jumping out at me in terms of CPU usage, and it's not swapping. I think it's cause some processes are waiting for disk IO, and I want to see ...
19
votes
1answer
9k views

Why does htop have three load averages?

On htop, it shows three load averages, one bold, one normal, one red. What do they signify?
17
votes
3answers
9k views

Show full process name in top

I'm running a rails stack on ubuntu. When I ps -AF, I get a descriptive process name set by the apache module like 00:00:43 Rails: /var/www... which is really helpful in diagnosing load issues. ...
14
votes
6answers
30k views

wa (Waiting for I/O) from top command is big

I have a forum with a lot of visitors, Some days the load increase to reach 40 without increase of the number vistors. As you can see from the below output, the waiting time is high (57%). how do I ...
14
votes
1answer
11k views

How to interpret output from Linux 'top' command?

Following a discussion made HERE about how PHP-FPM consuming memory, I just found a problem in reading the memory in top command. Here is a screenshot of my top just after restarting PHP-FPM. ...
14
votes
1answer
9k views

Memory Usage Numbers In top/htop

Can someone please explain this top output. Each PHP process is using 30% of the total memory or of the used memory? Furthermore how can it be that the combined used memory across all the PHP ...
12
votes
2answers
4k views

How is memory usage reported in Linux?

Using ps, I can see the size, the vsize (same as top's VIRT?), and the rss (same as top's RES?). (One more I see in top is SHR.) Could someone summarize for me what these different fields mean?
11
votes
3answers
7k views

What does %st mean in top?

Here is an example from my top: Cpu(s): 6.0%us, 3.0%sy, 0.0%ni, 78.7%id, 0.0%wa, 0.0%hi, 0.3%si, 12.0%st I am trying to figure out the significance of the %st field. I read that it means ...
10
votes
5answers
5k views

Confused by CPU values in Unix 'top' command

In the screenshot below, the overall CPU is being reported as 3% but the mysqld process is reported as using 57%. Is this 57% of the overall 3% and thus mysqld is only using about 1.5% of the CPU? ...
8
votes
3answers
18k views

Something eats all memory (I suspect memory leak on some app). How to detect what?

I have server which runs liquidsoap+icecast bundle and simple website (httpd+mysqld). Nothing special. Visitors around 2000+ per day, with around 50 being online simultaneously on average. Server has ...
8
votes
5answers
13k views

How to have linux top command show memory summary in megabytes not kilobytes

Redhat EL5 I had my top configured the just the way I like showing the memory summary and swap summary in MB. I had to close my shell and then when I re-opened it, it is back showing in (default ?) ...
8
votes
1answer
166 views

Is there a tool that can top-ify an input stream?

I come across quite a few use cases where it would be very useful to take input from a (usually newline-delimited) stream and summarise it in a top-like fashion (see top, iotop, etc). A kind of ...
6
votes
7answers
4k views

High CPU load but top processes in top all around 0%

We have a server with unusual high load and cpu util, but we can't figure out why. When we run top all the procs seem to be very low cpu. http://cl.ly/2d1g0K3q261r0R0K3e35 Is there a better way to ...
6
votes
1answer
2k views

Why does top report a different cpu usage than CloudWatch?

top shows an average CPU usage during peak times of about 20% while CloudWatch monitoring shows an average CPU usage of 40%. What causes this discrepancy?
5
votes
2answers
634 views

Load Average above 20 for single core vps on debian

OS: Debian 6.0 RAM:3072 M, CPU:single core. top: top - 08:56:43 up 21 days, 12:37, 1 user, load average: 28.38, 22.48, 15.95 Tasks: 8 total, 1 running, 7 sleeping, 0 stopped, 0 zombie ...
5
votes
4answers
622 views

Memory Usage in LINUX

I have a debian system. It has 8GB memory. When I do top it shows 7.9 GB memory used and rest free. I add up the memory usage of all the programs running from top and they hardly sum up to around 50 ...
5
votes
1answer
421 views

why top gives cpu percents more than 100%

see below statistics by "top -u steve", something is wrong with top? PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3490 steve 20 0 10444 312 248 R 114 0.0 23:33.22 ...
5
votes
2answers
2k views

How to get top command output to show rake arguments?

In the past, all of our servers have automatically shown command arguments passed to rake when we view them in top. For example: But on this particular server, we get this instead (picture is top ...
5
votes
1answer
423 views

Identify which process is responsible for heavy disk i/o under FreeBSD

I wonder how I can monitor which process takes out all my IO bandwith. The only command i know is gstat but it shows cumulative info. Is there any tools i can use to inspect the running processes for ...
5
votes
1answer
329 views

Mysterious swap usage on EC2

We're in the middle of a project to move our infrastructure from a co-lo situation into Amazon EC2 and we've noticed some weird memory characteristics of the processes in our setup. Without going into ...
4
votes
5answers
425 views

Give me my KILL-power when something goes wrong

We've had it a few times now. Suddenly our production server won't respond because a process is in an infinite loop, or the MySQL server stops serving new requests because one query is blocking ...
4
votes
2answers
464 views

Linux top command. Memory usage

I am testing my web server with Jmeter. I launch 40 users test, then dump top command. What i see, is 40 (+1 host) apache processes. Each process uses appr. 7mb of RES memory. But 7*40 is 280 mb of ...
4
votes
1answer
349 views

Why do I see many mongod processes running?

I am running a single MongoDB database. No sharding. When I run htop, I see a lot of instances of mongod. Is that normal? Does every connection create a separate mongod process? Should I be concerned? ...
4
votes
3answers
4k views

Why does 'top' indicate low memory usage, whilst 'free' indicates high memory usage?

Why does 'top' indicate low memory usage, whilst 'free' indicates high memory usage? Mem: 262144k total, 225708k used, 36436k free, 47948k buffers Swap: 262136k total, 40k used, ...
4
votes
5answers
1k views

Linux server performance profiling - how to see what caused high load

If a server is experiencing high load, I use top and similar tools to troubleshoot why. However, this is only effective if I can analyze while the server is experiencing the problem. What are some ...
4
votes
1answer
2k views

MongoDB virtual memory usage

I'm testing MongoDB for archives data. We have a collection with 160M rows. MongoDB instance takes 76.2 Gb virtual memory on a 12 Gb physical memory box ;-) The swap in null. I read that virtual ...
4
votes
2answers
2k views

how do you interpret output of top?

Some things in top's output are pretty straightforward, like memory and swap usage. But load average numbers are a bit of a mystery: what do these three numbers mean? Also, what exactly is a zombie ...
4
votes
1answer
498 views

How do you measure the memory footprint of a set of forked processes?

Say I've got a process using 200MB of memory, and it fork()s: python -c "import os; data='x'*200000000; os.fork(); raw_input()" Programs like 'top' will show each process using 200MB, with very ...
4
votes
4answers
4k views

How do I increase size of Terminal on Linux

I have a 48core linux box. I would like to monitor per core cpu usage. However when I use top and press 1 I get an error message "Sorry, terminal is not big enough" Is there anyway I can increase ...
4
votes
2answers
294 views

How to read `top`. Process list says processes have swap but overview says no swap is being used

I am using top to monitor my server. The swap row reads Swap: 1044220k total, 0k used, 1044220k free, 148544k cached I have hit O p to sort by swap. PID USER PR NI VIRT RES ...
4
votes
3answers
124 views

On a freshly-rebooted server why would the CPU running time of processes be huge?

I rebooted our server this morning, yet there are umpteen processes that appear to have been running for 600+ days? Could someone please shed some light? The datetime of the machine is correct: ...
4
votes
4answers
12k views

Find out what high CPU usage apache process is actually doing?

Currently having a few issues with our server where, intermittently, we seem to get apache processes which just run and run, taking up 100% CPU. When running top, we see the following: PID USER ...
3
votes
4answers
3k views

Monitoring linux processes

Is there an option for linux top command where i can filter processes by name? For example, I only want to monitor python processes (there are several of them), and I'd like to do something like top ...
3
votes
3answers
233 views

finding kernel space programs [duplicate]

how can we determine %sy process that is Consuming CPU. In the following case there is no netfilter and traffic is under 1 mbps.but still system process are taking too much cpu and cpu usage for ...
3
votes
2answers
2k views

Why does ec2 monitoring show 100% cpu and top only 20%?

I am running an python script on an ec2 instance that inserts rows in an database on another instance. In ec2's monitoring I saw a 100% cpu utilization, whereas top only shows 20% for the python ...
3
votes
2answers
2k views

How to exclude some users from Linux Top screen?

In top screen, by default it shows all users' processes. How to exclude some users(for example, root and nobody) from the top real-time screen?
3
votes
2answers
621 views

Where does top get its CPU usage data from?

I want to write some scripts that will measure the CPU use, but top's output, while pleasant for the user, isn't really feasible for processing in a script.
3
votes
2answers
2k views

How can I tell which page is creating a high-CPU-load httpd process?

I have a LAMP server (CentOS-based MediaTemple (DV) Extreme with 2GB RAM) running a customized Wordpress+bbPress combination . At about 30k pageviews per day the server is starting to groan. It ...
3
votes
2answers
7k views

is CPU actually occupied during iowait (%wa in top) on Linux / EC2?

On an 8-way Amazon EC2 instance (running Linux 2.6.21) with 8 EBS volumes and a lot of disk traffic, we see high %wa in top (30-40%), and high load average (8-9). My understanding is that processes ...
3
votes
1answer
440 views

Measuring load - %CPU in top is different than %us

When I run TOP on a remote server, I see a very small system utilization (3.8%us). However, for the actual process I am seeing 29.6% of the CPU. Since this server has 8 CPU cores, is the %CPU the ...
3
votes
1answer
512 views

Which PHP script is overloading my VPS?

Is there a way to get the PHP script filename that is currently hammering my VPS? For example, when I view "top", I see: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 7622 itil ...
3
votes
2answers
2k views

top in batch mode, need CPU% for every core

I know that after running top, I can press '1' and get a list of the CPUs with their utilization percentages. I suspect I can do this in batch mode too with the -b option, but I don't know how, and I ...
3
votes
4answers
3k views

Linux memory usage

We've been having some Linux memory usage problems on some of our servers. free, top, ps, and vmstat are all showing 261M free out of 1G (~25%). However, adding up the amount of memory shown per ...
3
votes
2answers
2k views

tail: inotify cannot be used, reverting to polling: Too many open files

tail: inotify cannot be used, reverting to polling: Too many open files I'm running apache and tomcat servers on Ubuntu (AWS ec2). Whenever I try to tail the catalina.out of tomcat I get too many ...
3
votes
1answer
1k views

top process state column under FreeBSD

When running top interactively, I can see various words in the state column : nanslp, biord, select, uwait, lockf, pause, kqread, piperd, sbwait ... Some like nanslp or kqread are self ...
3
votes
2answers
4k views

How to sort top result on virtual memory on Redhat Linux?

There is an interactive key "M" to sort by memory, which seems to be sorting on resident memory. Is there a way to sort on virtual memory? I happen to be working on Redhat Linux, but the question is ...
3
votes
2answers
257 views

Load average at 1, even though I've stopped all services!

I have a virtual server running Debian 5 where any action is very slow (like password verification when logging in via SSH or doing su). I checked the load average, which is hovering around 1-2. Then ...
3
votes
1answer
1k views

How can I find the source of my high load issues on Ubuntu server?

We have an Ubuntu 10.4 VPS serving a Rails site which often shows pretty high load, but doesn't have high CPU or memory numbers. Reading a lot of other questions here on Server Fault suggests to me ...