-2

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"

3 Answers3

1

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.

Aaron Copley
  • 12,345
  • 5
  • 46
  • 67
karthick
  • 663
  • 3
  • 7
  • 13
1

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

MySQL Documentation for SHOW PROCESSLIST

micah
  • 974
  • 6
  • 11
1

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.

daemonofchaos
  • 1,201
  • 1
  • 8
  • 10