mariadb.conf tweak for 32 GB RAM or more

Post Reply
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

If you have large RAM, you can put larger buffers in /etc/mysql/mariadb.conf :

Code: Select all

[client]
port=3306
socket=/var/run/mysqld/mysqld.sock

[mysqld_safe]
socket=/var/run/mysqld/mysqld.sock

[mysqld]
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log

symbolic-links=0

skip-external-locking
key_buffer_size = 512M
max_allowed_packet = 32M
# table_open_cache = 256
sort_buffer_size = 4M
net_buffer_length = 16K
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 128M
# thread_cache_size = 8
# query_cache_size= 16M
# thread_concurrency = 8

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=200
max_user_connections=199
# wait_timeout=30
interactive_timeout=50
long_query_time=5

table_open_cache = 20480
thread_cache_size = 384
query_cache_size = 50M
# thread_concurrency = 16
wait_timeout = 180
join_buffer_size = 16M
query_cache_type = 1
tmp_table_size = 512M
innodb_buffer_pool_size=4G

!includedir /etc/mysql/conf.d/
after that restart MariaDB:

Code: Select all

systemctl restart mysql
sparkzara
Posts: 22
Joined: Mon Jun 07, 2021 9:15 am

hi, thank you for the config file.
btw, can you help me optimize my server little more.
here is screenshot of ssh > top
Image

issues is cpu load of mysqld is always high.

Note:
Wordpress site with 40k post
around 1000 visitors + increasing
Server configuration
Digital Ocean
CPU-Optimized
Dedicated CPU
16 vCPUs
32 GB
200 GB SSD

is this something myvestacp can handle ?
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

sparkzara wrote: Tue Jun 22, 2021 10:45 am is this something myvestacp can handle ?
myVesta has nothing with MySQL/MariaDB.
You should check sql statements or optimize tables... https://mariadb.com/kb/en/optimization-and-tuning/ or similar tutorials.
Eventually you can switch from MariaDB to MySQL.
sparkzara
Posts: 22
Joined: Mon Jun 07, 2021 9:15 am

Thank you for the reply.

if i like to install myvestacp with mysql 8 newly, is that possible with install options while install ?
sparkzara
Posts: 22
Joined: Mon Jun 07, 2021 9:15 am

or should i upgrade mariadb with higher version.
whats your thought ?
Post Reply