Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can I make top show info about the web and db servers? Can it be done by piping the pids to the top? They can be many process from every one?!? Or is there any better method for this?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

In the case of web and database users, they usually run as their own user. You can use the -u flag to show only processes running as a certain user like this: top -u mysql. You may also use the -p flag with a comma separated list of PIDs you want to follow like this: top -p 123,234,345.

You might also find htop more useful in this situation. Besides the options above it has much more flexible display options including following selected items so you don't loose them in the list. Once you setup your columns and sort order, turn on tree mode and then follow the parent of the server you are interested in. All it's children should show up just under the cursor.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.