As we all know, MySQL has slow query log, and we can tell that those SQL statements have performance problems based on the slow search logs. As a good partner for MySQL, PHP has the same functionality. If you use PHP-FPM to manage PHP, you can open it with the following options.
The PHP 5.3.3 was previously set as fol
1.MySQL 5.5 command line inside
Copy Code code as follows:
Set global log_slow_queries = on; # Open Slow Log
Set [Session|global] long_query_time = 0.2 # setting time. Precise milliseconds
Set global log_queries_not_using_indexes = on; # set up a query without indexes
2. View the form of the store logMysql> Show variables like ' log_
This article describes how to query logs and slow query logs in MySQL. It also describes how to use the Mysqldumpslow log analysis tool that comes with MySQL. For more information, see
I. query logs
Query all the queries in MySQL
difficult to find, and the parameters related to slow query more, how these parameters work, how is the relationship between the conditions of the SQL statement will be recorded in the slow log? Only by understanding these can we make better use of slow logs for system tuni
Description: The optimization case is to express the meaning of the individual parameters, combining the analysis of the business with the logical implementation, and how to create the index and column order is selected (no longer described here)Environment Description :MongoDB version 3.0.9, replica set 3 node, memory 64g,cpu core, disk 2TB SSD, using WT storage engine ...The amount of data in this table is more than 260 million.The general analysis is as follows:
View the classificati
This article describes the PHP performance analysis of php-fpm slow execution log slow logs usage. Share to everyone for your reference, specific as follows:
As we all know, MySQL has slow query log, and we can tell that those SQ
Analysis of slow query logs by pt-query-digest in MySQL, ptquerydigest
I. Introduction
Pt-query-digest is a tool used to analyze mysql slow queries. It can analyze binlog, General log, and slowlog, you can also use SHOWPROCESSLIST
Reference article:Http://ourmysql.com/archives/1359?utm_source=tuicoolutm_medium=referralOfficial: Https://github.com/box/AnemometerSingle-node anemometer monitoring1 Installing Anemometer# cd/data/www/web3# git clone https://github.com/box/Anemometer.gitanemometer CD anemometer2 Creating tables and user names# mysql-uroot-proot We can look at the following table structure as follows650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/82/C2/wKioL1dgsumQ5XJvAABppErvjtI393.png "style=" floa
PHP Small Code---separate log records from slow log files and store them in an Excel file
GetProperties ()->settitle ("Export")->setdescription ("none"); $objPHPExcel->setactivesheetindex (0); $ Objphpexcel->getactivesheet ()->getcolumndimension (' A ')->setwidth, $objPHPExcel->getactivesheet ( )->getcolumndimension (' B ')->setwidth (+), $objPHPExcel->getact
sec)
Mysql> set slow_query_log = 'on'; // Add global. Otherwise, an error is returned.
ERROR 1229 (HY000): Variable 'slow _ query_log 'is a GLOBAL variable and shocould be set with SET GLOBAL
Mysql> set global slow_query_log = 'on'; // enable slow Query
Query OK, 0 rows affected (0.28 sec)
Mysql> show varia
Database optimization tutorial (3) Slow query of records and database optimization tutorial Query1. Slow query foundIn the previous section, we made data preparation for slow queries. This section allows us to find slow queries an
Database optimization tutorial (3) Slow query of records and database optimization tutorial Query1. Slow query foundIn the previous section, we made data preparation for slow queries. This section allows us to find slow queries an
Kafka cluster
Logstash reads the Kafka cluster data and splits it into JSON format into the ES cluster after splitting by field
Kibana read ES cluster data on a Web page
Slow Log classification
Currently the main use of the MySQL version has 5.5, 5.6 and 5.7, after careful comparison found that each version of the slow
server| Speed | optimization
MS SQL Server Query optimization method (1) There are many reasons for the slow query speed, common as follows:
1, no index or no index (this is the most common problem of query slow, is the defect of program design)2, I/O throughput is small, cr
and summarize the MySQL slow query log. Options are
--verbose verbose
--debug Debug
--help write this text to standard output
-V Verbose
-D debug //Troubleshooting
-S order what to sort by (t, at, L, AL, R, AR etc), "at" is default //sorted by query count, time, lock time and number of record
-1.el5Php53-bcmath-5.3.3-1.el5Php53-mysql-5.3.3-1.el5Php53-dba-5.3.3-1.el5Php53-cli-5.3.3-1.el5Php53-gd-5.3.3-1.el5Php53-5.3.3-1.el5Php53-pdo-5.3.3-1.el5Note:PHP version is greater than 5.3, or error, such as:Anemometer requires PHP 5.3 or newer. You have 5.1.6In addition to: BcmathRpm-qa|grep BcmathPhp53-bcmath-5.3.3-1.el54. Execute the setup script to create the user:[[Email Protected]/var/www/html/anemometer]mysql-uroot-pxxx [[Email protected]/var/www/html/anemometer]mysql-uroot-pxxxMySQL > G
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.