mysql show full processlist Comments

mysql server recently occasional case of high cpu hundred percent, so the need for analysis

Brothers command show processlist; lists only the first 100, if you want the full list, please use the show full processlist;

 

 

 

First briefly about the meaning and purpose of each column:

           id columns, do not say it, a logo, a statement to kill you when useful.

       user column is displayed before the single user, if not root, this command will only display the sql statement within your purview.

       host column, display the statement was issued from which port to which the ip. Oh, it can be used to track a user problem statement.

         db column that shows the process which is currently connected to the database. command column, the underlying command for the current connection, the general is dormant (sleep), query (query), connect (connect).

       time column, the duration of this state, in seconds.

      state column displays the status of the use of the sql statement for the current connection, it is important columns, follow-up will describe the status of all, please note, statement is executed only state in one state, a sql statement, the query has been, for example, may need to go through copying to tmp table, Sorting result, Sending data can be completed before other state,

     info column displays the sql statement, because of the limited length, so long sql statement to display incomplete, but an important basis for a judgment statement.

      This command is the most critical is the state column, state mysql listed are the following:

     Checking table 
     Checking the data table (which is automatic).  Closing tables  are modified to refresh the table data to disk, while being closed has been used up table. This is a very fast operation, if not the case, you should verify that the disk space is full or if the disk is in the burden.  Connect Out  copied from the server is connected to the main server.     Copying to tmp table on disk  because of a temporary result set is greater than tmp_table_size, the temporary tables are stored in memory in order to save memory from disk into memory.     Creating tmp table is to create a temporary table to hold part of the query results.    deleting from main table  server is executing the first part of the multi-table delete, just delete the first table.    deleting from reference tables  server is executing the second part of the multi-table delete, Deleting records to other tables.    Flushing tables  executing FLUSH TABLES, waiting for other threads to close the data table.    Killed  sent a request to kill a thread, then the thread will check the kill flag, and it will give up the next kill request. MySQL checks the kill flag in each of the main loop, but the thread may be too short in some cases to die. If the thread is locked away another thread, then the request will take effect immediately kill the lock is released.    Locked 
   

   



 










Other queries were locked. 
   Sending data 
is being processed record SELECT query, and the results are sent to the client. 
   Sorting for group 
're doing is sort GROUP BY. 
   Sorting for order 
're doing is sort ORDER BY. 
   Opening tables 
This process should be soon, unless subject to interference from other factors. For example, before executing LOCK TABLE statement or ALTER TABLE finish line, the data table can not be opened by other threads. We are trying to open a table. 
   Removing duplicates 
is executing a query SELECT DISTINCT way, but MySQL can not optimize away those duplicate records in the previous stage. Thus, MySQL duplicate records need to be removed again, and then sends the results to the client. 
   Reopen table 
to get a lock on a table, but it must be to get the lock on the table after structural modifications. Lock has been released, close the data table, you are trying to reopen the table. 
   Repair by sorting 
repair instructions are sorting to create indexes. 
   Repair with keycache 
repair instruction cache is using the index one by one to create a new index. It will be slower than Repair by sorting more. 
   Searching rows for update 
is talking about matching records to find out for future updates. It must be completed before the UPDATE to modify the relevant records. 
   Sleeping 
is waiting for the client to send a new request. 
   System Lock 
is waiting to get an external system lock. If no mysqld server running a plurality of simultaneous requests from the same table, the lock can be disabled by increasing the external system --skip-external-locking parameter. 
  Pgrading Lock U 
INSERT DELAYED is trying to get a lock table to insert a new record. 
  Updating 
is searching for matching records, and modifies them. 
  User Lock 
is waiting GET_LOCK (). 
  Waiting for tables 
The thread is notified, the data table structure has been modified, need to re-open the data table to get the new structure. Then, in order to be able to re-open the data table, you must wait until all other threads to close the table. This notification will have the following cases: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE. 
  INSERT Handler for Waiting 
the INSERT DELAYED insert operation has finished processing all pending, waiting for a new request. 
Most states correspond to very fast operation, as long as there is a thread to keep the same state for several seconds, then there might be a problem, should be checked. 
There are other states not listed in the above, but most of them just to see if there is an error that the server only need it.

文章转自:http://blog.csdn.net/gumanren/article/details/4658385

 

Guess you like

Origin www.cnblogs.com/tongcharge/p/11495393.html