我有一个使用过多 CPU 的 MySQL 数据库。我实际上正在对查询数据库的 Web 服务器执行基准测试。现在数据库是瓶颈,它使用了太多的 CPU。VM 有 5 个 vCPU 和 4GB 内存。
我可以做任何更改以减少 CPU 使用量吗?并提高性能?
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
# …
Run Code Online (Sandbox Code Playgroud)