2017-07-26 332 views
-1

32核心處理器(Windows 2012),大功率機器。 MySQL配置對線程數沒有限制。但即使在前端可以看到大量用戶活動,並且MYSQL監控顯示每秒執行的查詢超過1000個,但threads_running永遠不會超過3。這是因爲查詢速度快,並且不需要多線程同時運行?MySQL threads_running始終保持在3

Delayed_insert_threads 0 
Slow_launch_threads 0 
Threads_cached 0 
Threads_connected 21 
Threads_created 138 
Threads_running 3 

要使配置文件發生什麼變化,才能充分利用服務器的容量?

這些是與線程相關的配置設置。

thread_cache_size=10 
innodb_thread_concurrency=0 
innodb_read_io_threads = 64 
innodb_write_io_threads = 64 
innodb_purge_threads = 8 
+1

https://stackoverflow.com/questions/29587322/mysql-server-not-fully-utilized-threads-running-is-lesser-than-2 –

+0

@DitgitalChris是的,我看到之前我寫這個問題,但那答案沒有幫助。 –

+0

步驟0-檢查您的性能問題是否需要排除故障? http://www.speedemy.com/troubleshooting-mysql-performance-step-zero-check-performance-problem-troubleshoot/ –

回答

0

thread_cache_size = 100#將從10減少線程創建/銷燬抖動。 V8表示您應該將此數字設爲100,以避免超載和可能的情況。

對於更詳細的分析,請添加到OriginalPost如下:

RAM on the dedicated server 
SHOW GLOBAL STATUS; 
SHOW GLOBAL VARIABLES; 
SHOW ENGINE INNODB STATUS; 

長達五個具體的配置建議將應用於每天一個。