Thứ Ba, Tháng Mười Hai 12, 2023
Tin nóng
HomeControl PanelcPanel/WHMMySQL Tweaking – Tối ưu MySQL

MySQL Tweaking – Tối ưu MySQL

Với hay cài đặt bình thường bao giờ sau khi cài xong MySQL cũng chạy với những config mặc định. Nó không tối ưu và tốt cho server. Đặc biệt là với hosting provider.
Đây là cấu hình tốt cho MySQL.
Sửa file /etc/my.cnfXóa hết nội dung đã có, thay thành:

[mysqld] max_connections=900
max_user_connections=50
skip-locking
skip-innodb
query_cache_limit=1M
query_cache_size=32M
query_cache_=1
interactive_timeout=50
wait_timeout=50
connect_timeout=10
thread_cache_size=128
key_buffer=256M
max_allowed_packet=16M
table_cache=1024
join_buffer=1M
sort_buffer_size=1M
read_buffer_size=1M
max_connect_errors=10
thread_concurrency=4
myisam_sort_buffer_size=64M
-bin
server-id=1

[safe_mysqld] open_files_limit=8192

[mysqldump] quick
max_allowed_packet=16M

[mysql] no-auto-rehash
[isamchk] key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk] key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy] interactive-timeout

cPanel.vn

Bình luận

bình luận