I am currently experiencing an issue with my MariaDB server where it is excessively using swap memory, leading to significant performance degradation. I am not sure why the swap memory usage is so high, and I am worried about the impact of this “memory bomb” on my server’s performance. Here are the details of my current setup and the steps I have taken so far:
Server Setup:
Database Server: MariaDB 10.11
-
Physical Memory (RAM): [used / total] 13 Gi / 15 Gi
-
Swap Space: [used / total] 5.7 Gi / 8.0 Gi
-
Operating System: Rocky Linux 8.8 (Green Obsidian)
Observations: -
Excessive Swap Usage: The top command shows a high amount of swap memory usage.
enter image description here -
Swap memory use (using /proc/$pid/status)
Name=mariadbd – Swap used: 5268960 KB -
Current Memory Status (using SHOW STATUS LIKE ‘Innodb_buffer_pool%’;):
Innodb_buffer_pool_pages_data: 713855
Innodb_buffer_pool_bytes_data: 11695800320
Innodb_buffer_pool_pages_dirty: 12714
Innodb_buffer_pool_bytes_dirty: 208306176
Innodb_buffer_pool_pages_flushed: 17316310
Innodb_buffer_pool_pages_free: 1
Innodb_buffer_pool_pages_made_not_young: 52897922
Innodb_buffer_pool_pages_made_young: 11348673
Innodb_buffer_pool_pages_misc: 0
Innodb_buffer_pool_pages_old: 263492 -
innodb local memory
max_connections | 5000
read_buffer_size | 131072
read_rnd_buffer_size | 262144
sort_buffer_size | 2097152
join_buffer_size | 262144
thread_stack | 299008
Threads_connected | 981
Questions:
Why is my MariaDB server using so much swap memory?
Are there specific configurations or settings I should check or adjust to mitigate swap usage?
Could there be memory leaks or inefficient memory usage in my current setup?
What best practices should I follow to optimize memory usage and avoid swap memory dependency?
이민수 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.