Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: Mtop (MySQL Database Server Monitoring)  (Read 3615 times)

0 Members and 1 Guest are viewing this topic.

Vinil

  • Guest
Mtop (MySQL Database Server Monitoring)
« on: February 07, 2014, 05:15:51 am »
mtop (MySQL top) is an open source real time MYSQL Server monitoring program that shows queries which are taking longer time to process and kills those longer queries after certain number of specified time. Mtop program enable us to monitor and identify performance and related issues of MySQL Server from the command line interface similar to Linux Top Command.


Please check some of the following features offered by Mtop program.

* Display real time MySQL server queries.
* Provides MySQL configuration information.
* Zooming feature to display process query.
* Provides query Optimizer information for a query and ‘killing’ queries.
* Provides MySQL tuning tips.
* Ability to save output in a .mtoprc configuration file.
* Provides Sysadmin recommendation page (‘T‘).
* Added queries/second to main header.
* Added per second info to stats screen.


Install RPMForge on RHEL/CentOS 6

First, you need to enable RPMForge repository under your Linux machine to download and install latest version of MTOP program.

For RHEL/CentOS 6 32-Bit OS

Code: [Select]
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.i686.rpm

For RHEL/CentOS 6 64-Bit OS

Code: [Select]
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -Uvh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm


Install Mtop in RHEL/CentOS

Quote
# yum install mtop


Starting Mtop in RHEL/CentOS

To start Mtop program, you need to connect to your MySQL Server, using following command.

Quote
# mysql -u root -p

mysql> grant super, reload, process on *.* to mysqltop;
Query OK, 0 rows affected (0.00 sec)

mysql> grant super, reload, process on *.* to mysqltop@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye


Running Mtop in RHEL/CentOS

Quote
# mtop

Code: [Select]
load average: 0.01, 0.00, 0.00 mysqld 5.1.61 up 5 day(s), 19:21 hrs
2 threads: 1 running, 0 cached. Queries/slow: 5/0 Cache Hit: 71.43%
Opened tables: 0  RRN: 277  TLW: 0  SFJ: 0  SMP: 0  QPS: 0

ID       USER     HOST         DB       TIME   COMMAND STATE        INFO
322081   mysqltop localhost Query show full processlist


Monitor Remote MySQL Server using Mtop

Code: [Select]
# mtop  –host=remotehost –dbuser=username –password=password –seconds=1