Wishlist 0 ¥0.00

MySQL服务器的线程数查看方法

MySQL服务器的线程数需要在一个合理的范围之内,这样才能保证MySQL服务器健康平稳地运行。Threads_created表示创建过的线程数,通过查看Threads_created就可以查看MySQL服务器的进程状态。

 

 

 
  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. +-------------------+-------+ 

 

如果我们在MySQL服务器配置文件中设置了thread_cache_size,当客户端断开之后,服务器处理此客户的线程将会缓存起来以响应下一个客户而不是销毁(前提是缓存数未达上限)。

Threads_created表示创建过的线程数,如果发现Threads_created值过大的话,表明MySQL服务器一直在创建线程,这也是比较耗资源,可以适当增加配置文件中thread_cache_size值,服务器
thread_cache_size配置:

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

About Us

Since 1996, our company has been focusing on domain name registration, web hosting, server hosting, website construction, e-commerce and other Internet services, and constantly practicing the concept of "providing enterprise-level solutions and providing personalized service support". As a Dell Authorized Solution Provider, we also provide hardware product solutions associated with the company's services.
 

Contact Us

Address: No. 2, Jingwu Road, Zhengzhou City, Henan Province

Phone: 0086-371-63520088 

QQ:76257322

Website: 800188.com

E-mail: This email address is being protected from spambots. You need JavaScript enabled to view it.