Yahoo open-source MySQL Performance Analysis Tool (MySQL Performance Analyzer ),

Source: Internet
Author: User
Tags java jdk 8

Yahoo open-source MySQL Performance Analysis Tool (MySQL Performance Analyzer ),

Address: https://github.com/yahoo/mysql_perf_analyzer

MySQL Performance Analyzer is an open source project for MySQL performance monitoring and analysis. This repository implements des two sub projects: Java web application project myperf Java web server jetty wrapper

MySQL Performance Analyzer is an open-source MySQL performance monitoring and analysis project. It includes two sub-projects: Java web Application Project myperf and Java web Server jetty wrapper.

MySQL Performance Analyzer is a Java Maven project. JDK and Maven 3.0 or later are required to build it.

MySQL Performance Analyzer is a Java Maven project. JDK and Maven3.0 are required for building.

Although JDK 8 is specified in pom. xml, this project does not use Java 8 specific features, so the user can modify pom. xml files of the two sub projects to use different JDK version. for example, if the build host only has JDK 7, modify the file myperf/pom. xml, change the lines

Although JDK8 is included in pom. xml, this project does not use the Java 8 feature. Therefore, you can modify the pom. xml files of these two subitems to apply different JDK versions. For example, if the build host only has JDK 7, modify the myperf/pom. xml file and set the following content:

    <source>1.8</source>    <target>1.8</target>

To change

    <source>1.7</source>    <target>1.7</target>

The build will create a zip file named as myperfserver-server.zip under directory perfJettyServer/target. To build it, at top level, run

A zip file: myperfserver-server.zip is generated under the perfJettyServer/target directory at build time. Prepare the building and run the following command at the top layer:

  mvn clean package
Installation and Usage Instructions
  1. Requirement: Java JDK 8, or the one specified by in pom. xml if changed during build time.
    Required Software: Java JDK 8 or the version modified in the pom. xml file.

  2. Unzip myperfserver-server.zip to the desired installation directory. If you intend to install on Windows host, please review two shell scripts and create Windows equivalent.
    Extract the compressed file myperfserver-server.zip to the installation directory. If the installation is in Windows, preview the two shell scripts and add them to the environment variables.

  3. For a more formal installation, it is recommended to have a MySQL database server to store the metrics. otherwise, use the built-in derby db. a. create a database, for example, named as metrics, with the MySQL database server. b. create a MySQL user (for example, 'metrics' @ 'my _ host'-> here my_host is the machine where you MySQL perf analyzer) with all privileges on above schema. c. the above information will be required when you first login to the analyzer to setup metrics gathering.
    For general installation, you need to install the MySQL database for storage. Otherwise, you can use the built-in derby database. A. Create a database on the database server, such as metrics. B. Create a MySQL user (for example, 'metrics' @ 'my _ host'-> here my_host is the host you want to analyze) with all permissions. C. The above information is required when you log on to the analyzer for setting for the first time.

  4. Review script start_myperf.sh to see if you need to modify any command line settings. usually, port number is the only one you need change-j: jettyHome, leave it as it is-p: http port to be used, 9092 by default-w: war (web archive) file, has to be myperf. war-k: working directory, if not specified, it will use. /work-c: url context, default to/myperf, leave it as is.
    Check the start_myperf.sh script to see if you need to modify the settings in the command line. Generally, the port number is the only one you need to modify. The parameter-j: jettyHome does not need to be modified. The parameter-p: http port is 9092 by default. The parameter-w: war (web compression), must be myperf. war; parameter-k: working directory. If not modified, use. /work; parameter-c: url content. By default, the url is redirected to the/myperf directory and remains unchanged.

    Modify java command path inside start_myperf.sh, if needed.
    If necessary, modify the path directory of the java command in the file start_myperf.sh.

  5. Start up:./start_myperf.sh Check nohup. out and logs directory for any error logs.
    Start command:./start_myperf.sh. Check the error logs of the nohup. out file and log directory.

  6. Shutdown:./stop_myperf.sh
    Close the command:./stop_myperf.sh

  7. First time Login and Setup After startup, point your browser to http: // your_host: 9092/myperf (or the port number you changed ). the initial login user and credential are myperf/change.
    When you log on after the first installation and startup, open http: // your_host: 9092/myperf (or another port you set) in the browser ). The initial username and password are myperf/change.

After login, you will be directed to setup page:
After logging in, you will be redirected to the installation settings page:

You can add an email address for communications. The email uses OS "mailx" command.
You can add a reminder email address. Use the "mailx" system command for emails.

Configure the metrics storage database, using the one that you created in the earlier steps. A metrics scan interval of 1 or 5 minutes shocould be good enough.
Configure the storage database and use the database created in the previous step. Set a scan cycle to 1 to 5 minutes.

If use built-in derbydb, choose short retention days.
If the built-in derbydb database is used, the retention date must be shortened.

After configuration is done, you need to start the partition ("Start transaction" button on top of the page ).
After the configuration is complete, you can Start scanning (the "Start transaction" button is at the top of the page ).

Everytime you change the configuration, you need to restart the operation.
After each configuration change, you need to restart the scanner.

If the specified does not work as expected, restart the analyzer./stop_myperf.sh then./start_myperf.sh
If the scanner is not working properly, restart the analyzer and run the command:./stop_myperf.sh then./start_myperf.sh.

  1. For each database server you want to monitor, you need to create a MySQL user with the following privileges:. process B. replication client c. show databases d. show view e. select on all (if you want to use it to check data dictionary or run explain plans)
    For each database server you want to monitor, you need to create users with the following permissions:. process B. copy client c. display database d. display View e. select All (if you want to use it to check the data directory or run the Instruction Plan)

  2. The analyzer relies on Linux SNMP to gather OS level data. Check snmpd service status.
    Analyzer depends on the Linux SNMP service to collect system-level data. Check whether the snmpd service is available.

Known Limitations
Known limitations
  1. Snmpd is based on the Linux specification.
    Snmpd is based on linux specifications.
  2. Email notification uses Linux's "mailx" command.
    Email reminds you to use the Linux "mailx" command.
License
License

This code licensed under the Apache license. See the LICENSE file for terms.
The code is licensed under Apache. View the license file to view details.

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.