MySQL Status monitoring

Source: Internet
Author: User

mysqladmin-uroot-proot1234 ext Gets the status of MySQL

Queries Number of queries

threads_connected Current number of open links

threads_running number of threads concurrently executing query

The following statement allows you to query the values of the three states of the current MySQL

mysqladmin-uroot-proot1234 Ext|awk '/queries/{q=$4}/threads_connected/{c=$4}/threads_running/{r=$4}end{printf ("% D%d%d\n ", q,c,r)} '

Executes the command every second and assigns the output to the specified file

#!/bin/sh

While True

Do

mysqladmin-uroot-proot1234 Ext|awk '/queries/{q=$4}/threads_connected/{c=$4}/threads_running/{r=$4}end{printf ("% D%d%d\n ", q,c,r)} ' >>status.txt

Sleep 1;

Done

Using AB for pressure measurement

And then

awk ' {q=$1-last;last=$1}{printf ("%d%d%d\n", q,$2,$3)} ' Status.txt >>1111.txt

Make 1111.txt table observation status



MySQL Status monitoring

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.