In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
SHOW PROCESSLIST shows which threads are running. You can also use the mysqladmin processlist statement to get this information. If you have SUPER permission, you can see all threads. Otherwise, you can only see your own threads (that is, threads related to the MySQL account you are using).
If you do not use the FULL keyword, only the first 100 characters of each query are displayed.
This statement reports the host name of the TCP/IP connection (in host_name:client_port format) to easily determine which client is doing what.
This statement is very useful if you get a "too many connections" error message and want to know what is happening. MySQL reserves an additional connection to be used by accounts with SUPER privileges to ensure that administrators can connect and check the system at any time (assuming you don't give this permission to all users).
The most important thing in this command is the state column. Mysql lists the following states:
Checking table
Checking the datasheet (this is automatic).
Closing tables
The modified data in the table is being flushed to disk and the table that has been used up is being closed. This is a quick operation, and if not, you should make sure that the disk space is full or that the disk is under a heavy load.
Connect Out
The replication 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, temporary tables are being converted from memory storage to disk storage to save memory.
Creating tmp table
Creating a temporary table to hold some of the query results.
Deleting from main table
The server is performing the first part of the multi-table deletion, and the first table has just been deleted.
Deleting from reference tables
The server is performing the second part of the multi-table deletion and is deleting records for other tables.
Flushing tables
Executing FLUSH TABLES, waiting for another thread to close the data table.
Killed
If a kill request is sent to a thread, the thread will check the kill flag bit and abandon the next kill request. MySQL checks the kill flag bit in each main loop, but in some cases the thread may take a short time to die. If the thread is locked by another thread, the kill request takes effect as soon as the lock is released.
Locked
Locked by other queries.
Sending data
The record of the SELECT query is being processed and the results are being sent to the client.
Sorting for group
Sorting for GROUP BY.
Sorting for order
Sorting for ORDER BY.
Opening tables
This process should be very fast unless disturbed by other factors. For example, a data table cannot be opened by another thread until the execution of an ALTER TABLE or LOCK TABLE statement is complete. Trying to open a table.
Removing duplicates
An SELECT DISTINCT query is being executed, but MySQL cannot optimize those duplicate records in the previous phase. Therefore, MySQL needs to remove the duplicate records again and then send the results to the client.
Reopen table
A lock on a table is acquired, but the lock cannot be acquired until the table structure has been modified. The lock has been released, the datasheet has been closed, and an attempt is being made to reopen the datasheet.
Repair by sorting
The repair directive is sorting to create an index.
Repair with keycache
The repair instruction is using the index cache to create new indexes one by one. It will be slower than Repair by sorting.
Searching rows for update
We are talking about finding qualified records for updating. It must be done before UPDATE modifies the relevant records.
Sleeping
Waiting for the client to send a new request.
System lock
Waiting to acquire an external system lock. If you are not currently running multiple mysqld servers requesting the same table at the same time, you can disable external system locks by adding the-- skip-external-locking parameter.
Upgrading lock
INSERT DELAYED is trying to get a lock table to insert a new record.
Updating
Searching for matching records and modifying them.
User Lock
Waiting for GET_LOCK ().
Waiting for tables
The thread is informed that the data table structure has been modified and needs to be reopened to get the new structure. Then, in order to reopen the table, you must wait until all other threads close the table. This notification occurs in the following situations: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE.
Waiting for handler insert
INSERT DELAYED has processed all pending insert operations and is waiting for a new request.
Most states correspond to fast operations, and as long as one thread stays in the same state for a few seconds, there may be a problem that needs to be checked.
There are other states not listed above, but most of them are only useful to see if there are any errors on the server.
Mysql to view current connections
Command: show processlist
If it is a root account, you can see the current connections of all users. If it is another ordinary account, you can only see the connection occupied by yourself.
Show processlist; only lists the first 100 items. If you want to list them all, please use show full processlist.
Mysql > show processlist
Command: show status
Aborted_clients the number of connections that have been abandoned because the customer did not close the connection correctly.
The number of times Aborted_connects has attempted a connection to the MySQL server that has failed.
The number of times Connections attempted to connect to the MySQL server.
Created_tmp_tables the number of implicit temporary tables that have been created when the statement is executed.
The number of latency insertion processor threads being used by Delayed_insert_threads.
The number of rows written by Delayed_writes in INSERT DELAYED.
The number of rows written by Delayed_errors with INSERT DELAYED for which some errors (possibly duplicate key values) have occurred.
The number of times Flush_commands executed the FLUSH command.
The number of times Handler_delete requests to delete rows from a table.
The number of times Handler_read_first requests to read the first row in the table.
The Handler_read_key request number is based on the key reading line.
The number of times Handler_read_next requests to read a row based on a key.
The number of times Handler_read_rnd requests to read a row based on a fixed location.
The number of times Handler_update requests to update a row in the table.
The number of times Handler_write requests to insert a row into the table.
The number of blocks used by Key_blocks_used for keyword caching.
The number of times Key_read_requests requests to read a key value from the cache.
The number of times Key_reads physically reads a key value from disk.
Key_write_requests requests the number of times a keyword block is written to the cache.
The number of times Key_writes physically writes a key block to disk.
The maximum number of connections used simultaneously by Max_used_connections.
Not_flushed_key_blocks keyblocks that have been changed in the key cache but have not been emptied to disk.
The number of rows that Not_flushed_delayed_rows is waiting to write in the INSERT DELAY queue.
The number of Open_tables open tables.
The number of files opened by Open_files.
Number of Open_streams open streams (mainly used for logging)
The number of tables that Opened_tables has opened.
The number of queries sent by Questions to the server.
The number of queries that Slow_queries takes longer than long_query_time time.
The number of connections currently open by Threads_connected.
The number of threads that Threads_running is not sleeping.
How many seconds did the Uptime server work?
After create
This occurs when the thread creates a table (including internal temporary tables), at the end of the function that creates the table. This state is used even if the table could not be created due to some error.
Analyzing
The thread is calculating a MyISAM table key distributions (for example, for ANALYZE TABLE).
Checking permissions
The thread is checking whether the server has the required privileges to execute the statement.
Checking table
The thread is performing a table check operation.
Cleaning up
The thread has processed one command and is preparing to free memory and reset certain state variables.
Closing tables
The thread is flushing the changed table data to disk and closing the used tables. This should be a fast operation. If not, you should verify that you do not have a full disk and that the disk is not in very heavy use.
Converting HEAP to MyISAM
The thread is converting an internal temporary table from a MEMORY table to an on-disk MyISAM table.
Copy to tmp table
The thread is processing an ALTER TABLE statement. This state occurs after the table with the new structure has been created but before rows are copied into it.
Copying to group table
If a statement has different ORDER BY and GROUP BY criteria, the rows are sorted by group and copied to a temporary table.
Copying to tmp table
The server is copying to a temporary table in memory.
Copying to tmp table on disk
The server is copying to a temporary table on disk. The temporary result set was larger than tmp_table_size and the thread is changing the temporary table from in-memory to disk-based format to save memory.
Creating index
The thread is processing ALTER TABLE... ENABLE KEYS for a MyISAM table.
Creating sort index
The thread is processing a SELECT that is resolved using an internal temporary table.
Creating table
The thread is creating a table. This includes creation of temporary tables.
Creating tmp table
The thread is creating a temporary table in memory or on disk. If the table is created in memory but later is converted to an on-disk table, the state during that operation will be Copying to tmp table on disk.
Deleting from main table
The server is executing the first part of a multiple-table delete. It is deleting only from the first table, and saving columns and offsets to be used for deleting from the other (reference) tables.
Deleting from reference tables
The server is executing the second part of a multiple-table delete and deleting the matched rows from the other tables.
Discard_or_import_tablespace
The thread is processing an ALTER TABLE... DISCARD TABLESPACE or ALTER TABLE... IMPORT TABLESPACE statement.
End
This occurs at the end but before the cleanup of ALTER TABLE, CREATE VIEW, DELETE, INSERT, SELECT, or UPDATE statements.
Executing
The thread has begun executing a statement.
Execution of init_command
The thread is executing statements in the value of the init_command system variable.
Freeing items
The thread has executed a command. This state is usually followed by cleaning up.
Flushing tables
The thread is executing FLUSH TABLES and is waiting for all threads to close their tables.
FULLTEXT initialization
The server is preparing to perform a natural-language full-text search.
Init
This occurs before the initialization of ALTER TABLE, DELETE, INSERT, SELECT, or UPDATE statements.
Killed
Someone has sent a KILL statement to the thread and it should abort next time it checks the kill flag. The flag is checked in each major loop in MySQL, but in some cases it might still take a short time for the thread to die. If the thread is locked by some other thread, the kill takes effect as soon as the other thread releases its lock.
Locked
The query is locked by another query.
Logging slow query
The thread is writing a statement to the slow-query log.
NULL
This state is used for the SHOW PROCESSLIST state.
Login
The initial state for a connection thread until the client has been authenticated successfully.
Opening tables, Opening table
The thread is trying to open a table. This is should be very fast procedure, unless something prevents opening. For example, an ALTER TABLE or a LOCK TABLE statement can prevent opening a table until the statement is finished.
Preparing
This state occurs during query optimization.
Purging old relay logs
The thread is removing unneeded relay log files.
Query end
This state occurs after processing a query but before the freeing items state.
Reading from net
The server is reading a packet from the network.
Removing duplicates
The query was using SELECT DISTINCT in such away that MySQL could not optimize away the distinct operation at an early stage. Because of this, MySQL requires an extra stage to remove all duplicated rows before sending the result to the client.
Removing tmp table
The thread is removing an internal temporary table after processing a SELECT statement. This state is not used if no temporary table was created.
Rename
The thread is renaming a table.
Rename result table
The thread is processing an ALTER TABLE statement, has created the new table, and is renaming it to replace the original table.
Reopen tables
The thread got a lock for the table, but noticed after getting the lock that the underlying table structure changed. It has freed the lock, closed the table, and is trying to reopen it.
Repair by sorting
The repair code is using a sort to create indexes.
Repair done
The thread has completed a multi-threaded repair for a MyISAM table.
Repair with keycache
The repair code is using creating keys one by one through the key cache. This is much slower than Repair by sorting.
Rolling back
The thread is rolling back a transaction.
Saving state
For MyISAM table operations such as repair or analysis, the thread is saving the new table state to the .MYI file header. State includes information such as number of rows, the AUTO_INCREMENT counter, and key distributions.
Searching rows for update
The thread is doing a first phase to find all matching rows before updating them. This has to be done if the UPDATE is changing the index that is used to find the involved rows.
Sending data
The thread is processing rows for a SELECT statement and also is sending data to the client.
Setup
The thread is beginning an ALTER TABLE operation.
Sorting for group
The thread is doing a sort to satisfy a GROUP BY.
Sorting for order
The thread is doing a sort to satisfy an ORDER BY.
Sorting index
The thread is sorting index pages for more efficient access during a MyISAM table optimization operation.
Sorting result
For a SELECT statement, this is similar to Creating sort index, but for nontemporary tables.
Statistics
The server is calculating statistics to develop a query execution plan.
System lock
The thread is going to request or is waiting for an internal or external system lock for the table. If this state is being caused by requests for external locks and you are not using multiple mysqld servers that are accessing the same tables, you can disable external system locks with the-- skip-external-locking option. However, external locking is disabled by default, so it is likely that this option will have no effect. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it).
Table lock
The next thread state after System lock. The thread has acquired an external lock and is going to request an internal table lock.
Updating
The thread is searching for rows to update and is updating them.
Updating main table
The server is executing the first part of a multiple-table update. It is updating only the first table, and saving columns and offsets to be used for updating the other (reference) tables.
Updating reference tables
The server is executing the second part of a multiple-table update and updating the matched rows from the other tables.
User lock
The thread is going to request or is waiting for an advisory lock requested with a GET_LOCK () call. For SHOW PROFILE, this state means the thread is requesting the lock (not waiting for it).
Waiting for tables, Waiting for table
The thread got a notification that the underlying structure for a table has changed and it needs to reopen the table to get the new structure. However, to reopen the table, it must wait until all other threads have closed the table in question.
This notification takes place if another thread has used FLUSH TABLES or one of the following statements on the table in question: FLUSH TABLES tbl_name, ALTER TABLE, RENAME TABLE, REPAIR TABLE, ANALYZE TABLE, or OPTIMIZE TABLE.
Waiting on cond
A generic state in which the thread is waiting for a condition to become true. No specific state information is available.
Writing to net
The server is writing a packet to the network.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.