Devs.tw 是讓工程師寫筆記、網誌的平台。歡迎您隨手紀錄、寫作,方便日後搜尋!
8 core CPU + 16 GB RAM
不知道主機到底在慢幾點的
隨便亂調一通之後
速度快多了
[mysqld]
query_cache_type = 1
query_cache_size = 1G
#query_cache_size = 0
query_cache_limit = 8M
innodb_buffer_pool_size = 9G
key_buffer_size = 3G
max_connections = 500
innodb_buffer_pool_instances = 8
<IfModule mpm_event_module>
# StartServers 2
# MinSpareThreads 25
# MaxSpareThreads 75
# ThreadLimit 64
# ThreadsPerChild 25
# MaxRequestWorkers 150
# StartServers 4
# MinSpareThreads 50
# MaxSpareThreads 150
# ThreadLimit 128
# ThreadsPerChild 50
# MaxRequestWorkers 300
# MaxConnectionsPerChild 0
ServerLimit 250
StartServers 10
MinSpareThreads 75
MaxSpareThreads 250
ThreadLimit 64
ThreadsPerChild 32
MaxRequestWorkers 4000
MaxConnectionsPerChild 5000
</IfModule>
2022-06-29 更新
主機規格加倍升級之後
上述設定值也通通加倍,但是效能出現瓶頸
決定調整 php-fpm
https://medium.com/@sbuckpesch/apache2-and-php-fpm-performance-optimization-step-by-step-guide-1bfecf161534
只調整
結果效能明顯改善!
觀察幾天,考慮再調成 24 or 32!