Mysql Performance monitoring Tool Innotop introduction and Configuration _mysql

Source: Internet
Author: User
Tags svn

1.innotop Installation
Reference website: http://innotop.googlecode.com/svn/html/installing.html

# wget http://innotop.googlecode.com/files/innotop-1.9.0.tar.gz
# TAR-ZXVF innotop-1.9.0.tar.gz 
# CD innotop-1.9.0

The installation of the Innotop tool is very simple, written by Perl, and of course requires a Perl environment and related toolkits. Before you install, make sure your system installs Time::hires,term::readkey,dbi,dbd::mysql four packages

# Perl-mcpan-eshell
cpan> Install time::hires
cpan> install
term::readkey cpan> Install DBI Cpan> Install Dbd::mysql

There are installation help files under the uncompressed source path, as follows:

# Perl makefile.pl

If there is no error, then use the

# make Install

This installs the Innotop, after the installation system will have one more command, Innotop

Get help

# Innptop--help

Reference website: http://innotop.googlecode.com/svn/html/manual.html

Innotop details--Very detailed: http://wenku.baidu.com/link?url=0cvUfYA5gwKfwvoo1gGPkr9NfK1eZ5UHa3gAhXB-pwlOLQDyH_Y_ Bn8q5kfii89rz_9egwjjlwmiqbsz4hogg0a-w1ngvnbmbrlqwmxgwz_

There is a slow parameter in the query list that can be configured to use in the/ETC/MY.CNF configuration file

It can record all the SQL statements that execute over long_query_time time, and help you to find the SQL that executes slowly, which makes it easier for us to optimize the SQL.

----- How to turn on MySQL slow query -----

1. First, enter MySQL, enter the command show variables like '%quer% ';

You will see that the state of the log_slow_queries is off;long_query_time to 10;

2. Edit/etc/my.cnf File

Add two lines under [mysqld]:

Log-slow-queries =/var/lib/mysql/mysql-slow.log
long_query_time = 3

Log-slow-queries a directory for the log; Long_query_time is the maximum number of seconds (set according to your needs).

3. Restart service to make configuration effective

/etc/init.d/mysqld restart

Re-enter database query log_slow_queries state is on.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.