View the processes of the MySQL server

Source: Internet
Author: User
Tags mysql functions

The number of threads on the MySQL server must be within a reasonable range to ensure the healthy and stable operation of the MySQL server. Threads_created indicates the number of created threads. You can view the process status of the MySQL server by viewing Threads_created.

 
 
  1. mysql> show global status like 'Thread%';  
  2. +-------------------+-------+  
  3. | Variable_name | Value |  
  4. +-------------------+-------+  
  5. | Threads_cached | 46 |  
  6. | Threads_connected | 2 |  
  7. | Threads_created | 570 |  
  8. | Threads_running | 1 |  
  9. +-------------------+-------+ 

If we set thread_cache_size In the MySQL server configuration file, after the client is disconnected, the thread on which the server processes this customer will be cached in response to the next customer rather than destroyed (provided that the number of caches has not reached the upper limit ).

Threads_created indicates the number of created threads. If the value of Threads_created is too large, it indicates that the MySQL server has been creating threads, which is also resource-consuming. You can add the value of thread_cache_size in the configuration file to query the server.
Thread_cache_size Configuration:

 
 
  1. mysql> show variables like 'thread_cache_size';  
  2. +-------------------+-------+  
  3. | Variable_name | Value |  
  4. +-------------------+-------+  
  5. | thread_cache_size | 64 |  
  6. +-------------------+-------+ 

The server in the example is healthy.

How to enable MySQL slow Query

Two methods for implementing MySQL multi-table join query

Introduction to MySQL CONVERT Functions

How to Create MySQL Functions

Take you to understand mysql Variables

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.