0

I have a mysql 8.0.31 running in docker form (the server is running ubuntu) the problem i am having is that after each backup that i run (i run it every hour) the ram consumption increases and never decreases. Its consuming around 500mb of ram after each backup. So at the end of the day its consuming all the ram of my server and i am having to do a docker restart of the database

the way i am doing the backup is the following

docker exec container-name /usr/bin/mysqldump -u database-name --password=xxxxxx -R --databases name_of_database > ./name_of_file.sql

The conf file looks like this:

[mysqld]
performance_schema=ON
max_digest_length=4096
performance_schema_max_digest_length=4096
performance_schema_max_sql_text_length=4096
performance-schema-consumer-events-statements-current=ON
performance-schema-consumer-events-waits-current=ON
performance-schema-consumer-events-statements-history-long=ON
performance-schema-consumer-events-statements-history=ON
max_connections=250
slow_query_log = 1 
slow_query_log_file = /var/log/mysql/file_for_logs.log 
long_query_time = 5
innodb_buffer_pool_size = 4G

any ideas of what could be wrong?

3
  • Additional DB information request, please. OS, Version? RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post TEXT data on justpaste.it and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions. Commented Feb 6 at 1:24
  • Post TEXT data on justpaste.it and share the links. Additional very helpful OS information includes - please, htop 1st page, if available, TERMINATE, top -b -n 1 for most active apps, top -b -n 1 -H for details on your mysql threads memory and cpu usage, ulimit -a for list of limits, iostat -xm 5 3 for IOPS by device & core/cpu count, df -h for Used - Free space by device, df -i for inode info by device, free -h for Used - Free Mem: and Swap:, cat /proc/meminfo includes VMallocUused, for server workload tuning analysis to provide suggestions. Commented Feb 6 at 1:24
  • In your configuration [mysqld] section you may wish to consider, A) avoid using hyphens, use underscores. B) performance_schema should be referenced as performance_schema.(tbl_names). Commented Feb 6 at 1:33

1 Answer 1

0

innodb_buffer_pool_size must be less than the RAM (or virtual RAM) size. If you gave docker 4G, 2G might be a safe setting. If you gave it more, then 70% of RAM.

3
  • Thank you for your answer, the server has 16gb of ram. I gave it 4GB for innodb_buffer_pool_size, thats what makes it weird. The docker does not have a limit for ram and I only have this container running on this server and theres nothing else there. It just keeps using more and more ram, to the point where it eats up all of the 16GB of ram and makes the server crash. What I have noticed is that after each backup it increases ram usage by around 500mb and it never releases it Commented Jan 30 at 21:11
  • See if lowering max_connections to 50 helps. That is the second most likely setting for controlling RAM use. Also, check SHOW GLOBAL STATUS LIKE 'Max_used_connections'; Oh, maybe ther performance_schema is getting greedy. (Sorry I don't know what setting to check and change.)
    – Rick James
    Commented Jan 30 at 23:12
  • thank you Its just that I cannot have so little connections. I will check the max_used_connections, Im thinking some parameter is wrong as the ram increase only happens after a backup but is never freed Commented Feb 1 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.