Safe Way to Reduce innodb_log_file_size on MariaDB 11.4 + Performance Tuning Advice
Hello,
A few months ago, I attempted to reduce the innodb_log_file_size value from 32G to 2G. Unfortunately, this resulted in a crash of the MariaDB server. The process corrupted ib_logfile0 and ibdata1, rendering all databases unusable. I had to restore everything from backups. At the time, I followed instructions provided by ChatGPT, but likely missed a critical step.
I would now like to try again—this time more carefully—with proper guidance.
My goal is to set innodb_log_file_size=2G, if that's appropriate and safe.
Server Specs:
-
MariaDB version: 11.4
-
Websites hosted: ~130 WordPress sites
-
RAM: 196GB
-
CPU: 50 cores
-
Storage:
-
2 × 3.84 TB NVMe in software RAID 1 (main OS & high-performance sites – AlmaLinux 8)
-
2 × 16TB HDD in software RAID 1 (lower-traffic sites & mail storage)
-
-
Web server: LiteSpeed (2 workers) + QUIC.cloud
Observations:
-
Website frontend performance is excellent.
- Size of databases varies from 50MB to 1GB.
-
WordPress admin panels (saving posts, plugin updates, etc.) feel slower than expected—especially compared to other hosting environments.
-
CPU load is usually around 5% - 7%.
Questions:
-
What is the safest procedure to change
innodb_log_file_sizefrom 32G to 2G? -
Can you review my
my.cnf(below) and suggest any additional performance tuning, especially to improve WordPress admin responsiveness?
my.cnf content:
[client-server]
!includedir /etc/my.cnf.d
[mysqld]
# Server Optimization
log-error=/var/lib/mysql/xxxx.xxxx.xx.err
performance-schema=1
# innodb_force_recovery = 6
innodb_buffer_pool_size=96G
innodb_log_file_size=32G
innodb_log_buffer_size=512M
innodb_flush_log_at_trx_commit=2
innodb_flush_method=O_DIRECT
innodb_file_per_table=1
innodb_read_io_threads=16
innodb_write_io_threads=16
innodb_io_capacity=3000
innodb_io_capacity_max=6000
innodb_buffer_pool_instances=64
innodb_thread_concurrency=48
innodb_flush_neighbors=0
# innodb_numa_interleave=ON
innodb_page_cleaners=16
tmpdir = /dev/shm
# Connection Optimizations
max_connections=500
max_user_connections=450
wait_timeout=600
interactive_timeout=600
max_allowed_packet=512M
lock_wait_timeout=120
# Query Cache and Caching
query_cache_type=0
query_cache_size=0
join_buffer_size=1M
sort_buffer_size=1M
tmp_table_size=2G
max_heap_table_size=2G
table_open_cache=100000
table_definition_cache=100000
open_files_limit=250000
table_open_cache_instances=64
metadata_locks_cache_size=2048
# Buffering and Threading
thread_cache_size=256
thread_pool_size=36
thread_handling=pool-of-threads
read_buffer_size=1M
read_rnd_buffer_size=1M
# Authentication and Networking
plugin-load-add=auth_socket.so
unix_socket=OFF
bind-address=127.0.0.1
# Logging and Slow Query Log
log_slow_query=1
log_slow_query_file="/var/lib/mysql/slow.log"
log_slow_query_time=2
log_queries_not_using_indexes=0
log_slow_admin_statements=1
log_slow_slave_statements=1
# Replication and Binlog (if used)
binlog_format=ROW
expire_logs_days=7
-
Hey there! I'm not able to comment on specific performance improvements to your system, but I do have a few thoughts about this change.
The first, is that modern versions of cPanel & WHM have the WHM >> Edit Database Configuration tool, which will let you see all the values and their defaults directly in the WHM interface. The default value for innodb_log_file_size from MariaDB is 48M, which is what we show on that screen.
In the MariaDB documentation at https://mariadb.com/docs/server/server-usage/storage-engines/innodb/innodb-system-variables#innodb_log_file_size it says the following:
"From MariaDB 10.9 the variable is dynamic, and the server no longer needs to be restarted for the resizing to take place."
so I would expect you to be able to change this without performing any other extra work (stopping the database service, stopping cPanel monitoring, etc.) on the server. I also found a thread where an admin says this is dynamic here, and even shows the expected log output from a server where reducing the size worked properly:
https://community.centminmod.com/threads/changing-value-of-innodb_log_file_size.22185/
So I would say that it *seems* safe to change this without performing other work, but I personally would have backups ready to go.
0
Please sign in to leave a comment.
Comments
1 comment