View the mysql process -- show processlist

Source: Internet
Author: User


View the mysql process -- show processlist: Use show processlist to view the current running status. Mysql> show processlist; www.2cto.com, displays the IP address and port number from which the current process is sent. The db column shows which database the current process is connected to. The command column, displays the type or status of the commands executed by the current connection process, which is usually sleep, query, connect, and time, the Unit is seconds. The state column shows the status of the SQL statement that is connected to the current state. For example, if a query statement is used, it may need to experience copying to tmp table, Sorting result, the status such as Sending data can be completed. The info column displays the SQL statements executed by this connection. Because the length is limited, the long SQL statements are not displayed completely, but an important basis for determining the problem statement. Mysql lists the following States: the Checking table is Checking the data table (this is automatic ). Closing tables is refreshing the modified data in the table to the disk and Closing the used table. This is a very fast operation. If not, check whether the disk space is full or the disk is under a heavy load. Connect Out replication the slave server is connecting to the master server. Copying to tmp table on disk because the temporary result set is larger than tmp_table_size, the temporary table is being converted from memory storage to disk storage to save memory. Www.2cto.com Creating tmp table is Creating a temporary table to store some query results. The deleting from main table server is executing the first part of multi-table deletion. The first table has just been deleted. The deleting from reference tables server is executing the second part of multi-Table deletion and deleting records of other tables. Flushing tables is executing flush tables, waiting for other threads to close the data table. Killed sends a kill request to a thread, which will check the kill flag and discard the next kill request. MySQL checks the kill flag in each primary loop. However, in some cases, the thread may die after a short period of time. If the thread is locked by other threads, the kill request will take effect immediately when the lock is released. Locked is Locked by other queries. Sending data is processing the SELECT query record and Sending the result to the client. Sorting for group is Sorting group. Sorting for order is Sorting order. The Opening tables process should be fast unless it is disturbed by other factors. For example, before the alter table or lock table statement is executed, the data TABLE cannot be opened by other threads. Opening a table. Removing duplicates is executing a select distinct query, but MySQL cannot optimize those duplicate records in the previous stage. Therefore, MySQL needs to remove duplicate records and then send the results to the client. The Reopen table obtains the lock for a table, but the lock can be obtained only after the table structure is modified. The lock has been released, the data table is closed, and the data table is being re-opened. The Repair by sorting Repair command is being sorted to create an index. The Repair with keycache Repair command is using the index cache to create a new index one by one. It is slower than Repair by sorting. Searching rows for update is identifying qualified records for update. It must be completed before the related record is updated. Sleeping is waiting for the client to send a new request. System lock is waiting for an external System lock to be obtained. If multiple mysqld servers are not running to request the same table at the same time, you can add the-skip-external-locking parameter to disable external system locks. Upgrading lockINSERT DELAYED is trying to get a lock table to insert a new record. Updating is searching for matched records and modifying them. User Lock is waiting for GET_LOCK (). Waiting for tables this thread is notified that the data table structure has been modified. You need to re-open the data table to obtain the new structure. Then, in order to re-open the data table, you must wait until all other threads close the table. This notification is generated in the following situations: flush tables tbl_name, alter table, rename table, repair table, analyze table, or optimize table. Waiting for handler insertINSERT DELAYED has completed all the insert operations to be processed and is waiting for new requests. Most States correspond to fast operations. As long as one thread remains in the same state for several seconds, a problem may occur and you need to check it. Other statuses are not listed above, but most of them are only needed to check whether there are errors on the server.
 

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.