View mysql connection count and other commands

Source: Internet
Author: User


Run the show processlist command to view the mysql connection count. If the root account is used, you can view the current connections of all users. For other common accounts, you can only view the connections you are using. Www.2cto.com show processlist; only the first 100 items are listed. to list them all, use show full processlist; mysql> show processlist; command: show status; command: show status like '% The following Variable %'; the number of dropped connections because the client fails to properly close the connection. The number of connection times of the MySQL server that failed the Aborted_connects attempt. The number of times that Connections attempted to connect to the MySQL server. Created_tmp_tables: Number of implicit temporary tables created when the statement is executed. The number of threads that Delayed_insert_threads is using to insert a delayed processor. The number of rows written by Delayed_writes Using insert delayed.
The number of rows in which Delayed_errors writes data using insert delayed (which may duplicate key values. The number of times Flush_commands executes the FLUSH command. The number of rows that Handler_delete requests to delete from a table. The number of times the Handler_read_first request reads the first row of the table. The Handler_read_key request number is based on the key-read row. The number of times the Handler_read_next request reads a row based on a key. The number of times the Handler_read_rnd request reads a row based on a fixed position. The number of times Handler_update requests to update a row in the table. The number of times a Handler_write request inserts a row into a table. The number of Key_blocks_used Blocks Used for keyword cache. The number of times Key_read_requests requests read a key value from the cache. The number of times that Key_reads reads a key value from the disk physically.
Number of times that Key_write_requests requests write a key block to the cache. The number of times that Key_writes physically writes a key-Value block to a disk. The maximum number of connections simultaneously used by Max_used_connections. Not_flushed_key_blocks has been changed in the key cache but has not been cleared to the disk. The number of rows that Not_flushed_delayed_rows is waiting to write in the insert delay queue. The number of open tables in Open_tables. The number of open files in Open_files. Open_streams: Number of opened tables in Opened_tables (mainly used for logging. The number of queries sent by Questions to the server. Slow_queries takes more than long_query_time. The number of connections currently opened by Threads_connected. The number of threads whose Threads_running is not sleeping. How many seconds does the Uptime server work. My. ini configuration virtual memory www.2cto.com innodb_buffer_pool_size = 576 M-> 128 M InnoDB Engine Buffer query_cache_size = 100 M-> 32 query cache tmp_table_size = 102 M-> 32 M temporary table size key_buffer_size = 16 m -> set max_connections on 8 M: show variables like '% max_connections %' (this method is tested in debian + mysql Ver 12.22 Distrib 4.0.22, for pc-linux (i386. add the following red line to the cnf file :-------------------------------------------------------------------------------- Www.2cto.com [mysqld] port = 3306 # socket = MySQL skip-locking set-variable = key_buffer = 16 K set-variable = max_allowed_packet = 1 M set-variable = thread_stack = 64 K set- variable = table_cache = 4 set-variable = sort_buffer = 64 K set-variable = net_buffer_length = 2 K set-variable = max_connections = 32000 (syntax difference in mysql4.0 on the DELL machine in the courtyard max_connecionts = 2000 write this directly to www.2cto.com) ---------------------------------------- ---------------------------------------- After modification, restart MySQL. Of course, to ensure correct settings, check max_connections. Note: 1. Although 32000 is written here. However, the maximum number of connections allowed by the actual MySQL server is 16384. 2. Except max_connections, the above configurations should be configured according to your system's own needs. 3. The maximum number of connections allowed is added, it does not increase the system consumption much. 4. If your mysql instance uses my. ini as the configuration file, the settings are similar, but the settings must be slightly changed. Use mysqld -- help to view the max_connections variable at www.2cto.com. Or mysql> show variables after mysql-uuser-p; max_connections is also displayed.

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.