Jump to content
PHP論壇人

8.最佳化MariaDB資料庫


Recommended Posts

--------------------------
最佳化MariaDB資料庫
--------------------------

修改
vi /etc/my.cnf

 

有兩個 max_allowed_packet,都修改吧,都改成

max_allowed_packet = 1024M

 

 

這裡參考寶塔面板的優化

我雲主機的記憶體 2GB


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

 

 

儲存並離開
:wq

 


重新啟動資料庫
lnmp mariadb restart

 

 

重開機
sudo reboot

 

Link to comment

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...