Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

3 Answers 3

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
add comment

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
add comment

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
log-queries-not-using-indexes

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
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.