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

1
vote
2answers
2k views

Debian - top(1) in batch mode, but sorted by PID

I want to run top is batch / non-interactive mode with -b. However I want the output sorted by PID. What command line option does this? I'm using Debian Lenny and the -o pid option from here ( ...
0
votes
1answer
305 views

Seeing when was the last time a process ran in linux

Looking at top output on my linux server, I see a root owned process that is always in S mode whenever I look. How can I find out when was the last time it actually ran on a cpu and did something? ...
0
votes
1answer
540 views

Troubleshooting why my SSH sessions hang for a couple of seconds

I'm logged in to my development box via SSH (using PuTTY on my laptop) and periodically, the session would just hang for a couple of seconds then becomes responsive again. I have not been able to ...
1
vote
2answers
1k views

What value in 'top' output represents actual memory size of a process?

I'm running a Mac XServe as a dedicated apache mpm-prefork server with 8GB RAM. As part of the tuning process (I'm new to this), I'm trying to come up with the best value for MaxClients. To do so, I'm ...
16
votes
1answer
6k 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?
1
vote
2answers
357 views

FreeBSD: how can I make “top” not cut off commands?

I use top in a perl script for storing information about the system in DB. The actual command is: top -b -d1 -a all However the COMMAND field seems to be 60 chars max and everything else is cut ...
1
vote
4answers
844 views

Is there an easy way to insert data/time in front of a log file with just shell scripting?

Say I want to monitor memory usage on a java process overnight. I can do something like top | grep java > out.log I will get a log file with a whole bunch of lines. Is there an easy way to get a ...
1
vote
3answers
145 views

Odd MySQL zombie task

It seems to me like there's always 1 task in SQL that runs on my server at work and my personal stuff that gets "stuck" and keeps running forever. PID USER PR NI VIRT RES SHR S %CPU %MEM ...
8
votes
3answers
11k 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 ?) ...
2
votes
4answers
2k views

Linux high memory usage (top total mismatch)

I havea poor mans vps - 256MB dedicated RAM. I have installed LAMP. No website is currently UP on the server yet. The memory usage is still 225MB (only 31 MB free). I have measured using top and ...
1
vote
3answers
2k views

Apache processes all stuck in lockf state (via top)

I have an Apache server that's accessing source code over NFS (from a separate dedicated NFS file server). Periodically the Apache server stops accepting new requests (effectively bringing down the ...
0
votes
6answers
1k views

Ubuntu Linux, interpretation of top command result

I am a newbie to Linux OS and I had trouble on my drupal based sites which had turned out to be really slow. I am using 2 separate servers for hosting and MYSQL. On preforming the top command, I got ...
1
vote
7answers
908 views

Is it possible to change the cmdline of a running process (to more easily identify it in top, for example)?

I run a number of linux servers with VMware Server 2. When their response time is not so hot or the load average goes up, I open up top to see what's going on, or for our production servers I have top ...
70
votes
2answers
27k 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 ...
3
votes
5answers
969 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 ...
0
votes
1answer
465 views

What do all the numbers in `top` mean?

I've been using top command for a while, and I know what some numbers mean, but most of them are still a mystery. I would like to have an explanation about what each value means. I googled for this, ...
1
vote
2answers
5k views

Top shows load of 2.5: how can I find out which processes are waiting for the CPU?

I have a linux box hosting a pretty low-traffic site. It's an Amazon EC2 "small" instance, running Ubuntu 10.04. When I run "top" on it, I usually see a load of between 2 and 3, which in my ...
2
votes
4answers
2k views

On a freeBSD box - CPU idle from TOP is 0% but no process taking up cpu

On a freeBSD box, when I do TOP after starting a process x: CPU states: 34.4% user, 0.0% nice, 64.8% system, 0.8% interrupt, 0.0% idle Here, 0% idle. But the highest cpu using process is x ...
1
vote
2answers
402 views

How to log processes shown in top by user to a text file?

I need to log all processes (including the amount of CPU usage used, the time it was running for, etc...) to a txt file; preferably one entry per line as it appears in top. The user appears to be ...
0
votes
1answer
1k views

CPU load on CentOS Plesk server between 50-100% but processes only add up to around 10%

I've got a CentOS based Plesk VPS which keeps on slowing to a crawl. I checked what was happening with top, and found my load averages seem to be frequently spiking to very high numbers. After ...
4
votes
5answers
419 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 ...
11
votes
6answers
21k 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 ...
3
votes
2answers
577 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.
0
votes
1answer
681 views

SSH/bash 'w' command showing 2 users, but listing only 1?

so, pretty much, i was going about my server business as usual, when my SSH/bash terminal(PuTTY) decided to stop responding during a grep command. ^C wasn't letting me cancel out the job, so after a ...
1
vote
2answers
284 views

Top like viewer eating tail -f stream

Hi there I'm searching for a command line tool working with a stream of lines (tail -f typically) and counting them like : tail -f /var/log/apache2/access.log | cut -d' ' -f1 | SOME_COMMAND and ...
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 ...
5
votes
4answers
522 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 ...
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 ...
0
votes
1answer
669 views

What is normal SCSI error handling process (scsi_eh_3) CPU time usage?

Last week I got setup with a new dedicated server that is running 4x SCSI drives in RAID 10 on CentOS. The machine is pretty lightly loaded at the moment and has been running for 8 days. The process ...
13
votes
3answers
5k 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. ...
0
votes
2answers
473 views

Exclude a process from being listed in `top`

Is it possible to exclude some processes from being reported by top? For example, I would like to exclude itself from its listing (ie, I don't want top to show in the process list). I would also ...
1
vote
1answer
1k views

How do I change the output line length from the “top” linux command running in batch mode

The following command is useful to capture the current processes that are taking up the most CPU and store to a file: top -c -b -n 1 > top.log The -c flag is particularly useful because it gives ...
0
votes
5answers
117 views

top does not run

Sorry that I can't be very specific, only symtoms are provided: Monday morning a CentOS box, 1GB ram, Pentium 4 web server (thin, rails) does not response (too slow) to a browser of another PC ping ...
1
vote
3answers
92 views

Opening an existing process

I am using Eclipse in Linux through a remote connection (xrdp). My internet got disconnected, so I got disconnected from the server while eclipse was running. Now I logged in again, and I do the ...
3
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, ...
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 ...
2
votes
2answers
209 views

Provide Description for a Command for 'ps' Command Visibility

So the problem I want to find a tidy solution for is that when I log into a server (I have some Solaris and RHEL instances about), I try to find out what applications are running: $ ps -auxww | grep ...
1
vote
1answer
931 views

How do I list processes in htop by just their name, without the full path?

Is there a way to have the list of processes in htop only display as the name of the command, rather than the full pathname w/ flags?
0
votes
2answers
251 views

How should I read these figures from top? Where's the memory gone?

I'm looking at these figures in top: Mem: 3891192k total, 3659276k used, 231916k free, 25640k buffers Swap: 4449924k total, 0k used, 4449924k free, 1237416k cached and struggling ...
0
votes
1answer
261 views

[Unix]How do I know this particular mysql process belong to what process on `show processlist`

As stated on question's title, I ran into situations and I need to check something. Here's the condition. When I do top, I see mysql process with ID, say 1234. But, when I execute show processlist ...
0
votes
1answer
691 views

Is my centOS dedicated server caching disk files appropriately, or not?

Here's the head of the top output from my centOS 5 server, at a moment with very low load. What I want to know is whether it is using its free memory wisely to cache files from disk. Of 2G of RAM, ...
1
vote
3answers
88 views

Why one process is taking so many resources

My website is being very slow or non-responsive. A quick look at the top command shows me something like this: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 1709 mysql 20 ...
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 ...
1
vote
1answer
1k views

What could be causing load spikes on this EC2 instance?

I have an Amazon EC2 instance (c1.medium, ami-ed46a784) that experiences short spikes in load average every 32 hours or so. The average load is normally around 0.15 but rises to 3+ for about 15 ...
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
1answer
1k views

TOP cpu %ulitization exceeds number of procs X 100%

I have a VM with 2 virtual CPUs. When I run two multi-threaded java proceses the total CPU utilization in top exceeds 200%. In fact its closer to 800%. I thought that %CPU was the percentage ...
2
votes
5answers
735 views

%CPU for a process

Looking at the output of top on our server, one of my colleagues told me that the fact that some processes got less than 100 "%CPU" was because I was running too many processes. He added that based on ...
31
votes
5answers
10k 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 ...
1
vote
1answer
1k views

Running 'top' with 'Irix mode' off in batch mode

Can anyone tell me how I can tweak the following top command so that it always runs in Solaris mode in a batch mode operation? top -d 3 -n 2 -b -p <PID> I need 'top' to output a process' CPU ...
19
votes
3answers
13k 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 ...