Jump to content

5.MariaDB數據庫優化


Jack

Recommended Posts

Posted (edited)

------------------------
MariaDB數據庫優化
------------------------

依據自己的雲主機內存大小,做出相應的內存選擇,寶塔面板將自動調整底下的數據

 

例如 我用4GB內存的雲主機

寶塔面板 -> 軟件商店 -> 已安裝 -> MySQL 10.6-MariaDB -> 設置 -> 性能調整 -> 優化方案 -> 4-8GB

-> 保存 -> 重啟數據庫
 

 

 


--------------------------------
寶塔面板給的數據庫優化設置
--------------------------------

優化方案 2 - 4 GB
key_buffer_size = 256M
table_open_cache = 192
sort_buffer_size = 768K
read_buffer_size = 768K
read_rnd_buffer_size = 512K
thread_cache_size = 96
query_cache_size = 128M
tmp_table_size = 384M
max_connections = 200
innodb_buffer_pool_size = 384M
innodb_log_buffer_size = 16M

join_buffer_size = 2048K
thread_stack = 256K
binlog_cache_size = 64K

 

 

優化方案 4 - 8 GB
key_buffer_size = 384M
table_open_cache = 384
sort_buffer_size = 1024K
read_buffer_size = 1024K
read_rnd_buffer_size = 768K
thread_cache_size = 128
query_cache_size = 192M
tmp_table_size = 512M
max_connections = 300
innodb_buffer_pool_size = 512M
innodb_log_buffer_size = 16M

join_buffer_size = 2048K
thread_stack = 256K
binlog_cache_size = 128K
 

Edited by Jack
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...