How to optimize MySQL settings?
Posted by:
Jason Long
Date: September 13, 2023 07:05AM
Hello,
My server has 6 GB RAM and 4 virtual CPUs. MySQL uses a lot of RAM and CPU on my server compared to other programs. My MySQL configuration is:
[mysqld]
performance_schema = 0
show_compatibility_56 = 1
datadir = /var/lib/mysql
socket = /var/lib/mysql/mysql.sock
slow-query_log_file = /var/log/mysql-slow.log
log-error = /var/log/mysqld.log
max_allowed_packet=268435456
default_storage_engine = InnoDB
max_connections = 151
max_user_connections = 50
thread_cache_size = 151
query_cache_type = 1
query_cache_size = 64M
sort_buffer_size = 2M
tmp_table_size = 32M
read_buffer_size = 128k
read_rnd_buffer_size = 256k
join_buffer_size = 128k
table_definition_cache = 400
table_open_cache = 400
slow_query_log_file = slow.log
slow_query_log = 0
log_queries_not_using_indexes = 1
long_query_time = 0.5
min_examined_row_limit = 100
max_heap_table_size = 64M
innodb_buffer_pool_size = 10M
innodb_file_per_table = 1
innodb_flush_log_at_trx_commit = 2
innodb_log_buffer_size = 8M
innodb_log_file_size = 100M
log_bin
expire_logs_days = 7
Which part of the settings is wrong?
Thank you.
Subject
Written By
Posted
How to optimize MySQL settings?
September 13, 2023 07:05AM
September 15, 2023 04:43PM
September 15, 2023 05:38PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.