Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to get details of a process that is taking RAM. From top command i have found that Mysql is taking too much ram how can i know why Mysql is taking too much ram far from usual behavior?

Is there any commands to get more details of the process other than "ps"

share|improve this question

You may want to run SHOW PROCESSLIST within MySQL to get information about which queries are currently running.

MySQL Documentation for SHOW PROCESSLIST

share|improve this answer

mytop - A command line utility for monitoring real time MySQL Server performance. In order for mytop to function properly, you must have the following:

  • Perl 5.005 or newer
  • Getopt::Long
  • DBI and DBD::mysql
  • Term::ReadKey from CPAN

And the above, I have specified for linux distributions.

share|improve this answer

It sounds to like MySQL is having to create large in-memory temporary tables while processing an unoptimized query.

If it isn't enabled, enable the slow query log by adding the following to your my.cnf file:

log_slow_queries   = /var/log/mysql/mysql-slow.log
long_query_time    = 2

Then take a look at the /var/log/mysql/mysql-slow.log file. You should run EXPLAIN on each query listed in the file to get an idea of what is happening when that query is executed. With that knowledge you can optimize the query for better performance.

share|improve this answer

Your Answer


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.