Mysql runs out of memory during backup dumps (Docker container)MySQL keeps crashing OS server.. Please help adjust my.ini!mysqldump with single transaction option on live production serversImprove server performance by configuring MySQLMySQL becomes unresponsive a few times per hourwhy does mysql have so many more open and fragmented tables than tables in the DB?MySQL Tuning — High Memory UsageMysql running out of memoryCan't Track Down What's Causing Server To Go Out of MemoryFind out CPU and memory usage percent of Docker containerdocker multi container: Linking wordpress container with mysql container within a docker network
get unsigned long long addition carry
Was Mohammed the most popular first name for boys born in Berlin in 2018?
Two (probably) equal real numbers which are not proved to be equal?
Learning how to read schematics, questions about fractional voltage in schematic
How could a civilization detect tachyons?
Wiper fluid only squirts out for a second - Hyundai Accent 2006
What is the Ancient One's mistake?
What's an appropriate age to involve kids in life changing decisions?
Magical Modulo Squares
I'm attempting to understand my 401k match and how much I need to contribute to maximize the match
Is it possible to do moon sighting in advance for 5 years with 100% accuracy?
Why is the episode called "The Last of the Starks"?
Where do 5 or more U.S. counties meet in a single point?
Can I bring back Planetary Romance as a genre?
Is it safe to keep the GPU on 100% utilization for a very long time?
The unknown and unexplained in science fiction
Does this website provide consistent translation into Wookiee?
How to animate petals opening
Program for finding longest run of zeros from a list of 100 random integers which are either 0 or 1
How do I give a darkroom course without negatives from the attendees?
Can the Telekinesis spell be used on yourself for the following?
Company stopped my paying salary. What are my options?
How to explain intravenous drug abuse to a 6-year-old?
Can the president of the United States be guilty of insider trading?
Mysql runs out of memory during backup dumps (Docker container)
MySQL keeps crashing OS server.. Please help adjust my.ini!mysqldump with single transaction option on live production serversImprove server performance by configuring MySQLMySQL becomes unresponsive a few times per hourwhy does mysql have so many more open and fragmented tables than tables in the DB?MySQL Tuning — High Memory UsageMysql running out of memoryCan't Track Down What's Causing Server To Go Out of MemoryFind out CPU and memory usage percent of Docker containerdocker multi container: Linking wordpress container with mysql container within a docker network
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
We have a container running MariaDB, and a few other small containers on the host. The Mysql container was allocated 21G of memory (out of 32G total), as well as a few other parameters, with the following commands in the docker-compose:
db:
command:
- --innodb_buffer_pool_size=4294967296
- --query_cache_size=268435456
- --tmp_table_size=1073741824
- --max_heap_table_size=1073741824
- --table_open_cache=20000
- --max_connections=1000
- --performance_schema
mem_limit: 21g
The issue we have is that the mysql container runs out of memory during some routine backup operations, namely mysqldump commands, and the container just crashes.
Basically the container's memory usage creeps up to the 21G over about a week of use, and I think can stay there if we do not launch any "big" operation, but if a mysqldump command is launched, at some point during the dump that just puts it over its allocated limit, and it crashes (it does not when we have not reached ~95% of memory usage earlier in the week).
I don't understand why MySQL does not manage its memory better and frees up some of it to launch the new commands it needs to execute ?
We tried putting the mysqldump commands in a different container, to try to "isolate" this big operation, but that does not seem to change anything, the bulk of the work is still done by the Mysql container which ultimately crashes when the other container performs the dump.
What should we look into? Are our settings just totally out of whack? We set them up after running a mysqltuner.pl, and I can do a new run if you think that's where the problem lies.
We have about 700 databases, with ~40 tables each, and maybe about 10 simultaneous mysql connections in average with some spikes at 30 or 50. DBs run between 10Mb and 200Mb in size.
Any help appreciated, thanks!
mysql memory containers mysqldump
add a comment |
We have a container running MariaDB, and a few other small containers on the host. The Mysql container was allocated 21G of memory (out of 32G total), as well as a few other parameters, with the following commands in the docker-compose:
db:
command:
- --innodb_buffer_pool_size=4294967296
- --query_cache_size=268435456
- --tmp_table_size=1073741824
- --max_heap_table_size=1073741824
- --table_open_cache=20000
- --max_connections=1000
- --performance_schema
mem_limit: 21g
The issue we have is that the mysql container runs out of memory during some routine backup operations, namely mysqldump commands, and the container just crashes.
Basically the container's memory usage creeps up to the 21G over about a week of use, and I think can stay there if we do not launch any "big" operation, but if a mysqldump command is launched, at some point during the dump that just puts it over its allocated limit, and it crashes (it does not when we have not reached ~95% of memory usage earlier in the week).
I don't understand why MySQL does not manage its memory better and frees up some of it to launch the new commands it needs to execute ?
We tried putting the mysqldump commands in a different container, to try to "isolate" this big operation, but that does not seem to change anything, the bulk of the work is still done by the Mysql container which ultimately crashes when the other container performs the dump.
What should we look into? Are our settings just totally out of whack? We set them up after running a mysqltuner.pl, and I can do a new run if you think that's where the problem lies.
We have about 700 databases, with ~40 tables each, and maybe about 10 simultaneous mysql connections in average with some spikes at 30 or 50. DBs run between 10Mb and 200Mb in size.
Any help appreciated, thanks!
mysql memory containers mysqldump
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago
add a comment |
We have a container running MariaDB, and a few other small containers on the host. The Mysql container was allocated 21G of memory (out of 32G total), as well as a few other parameters, with the following commands in the docker-compose:
db:
command:
- --innodb_buffer_pool_size=4294967296
- --query_cache_size=268435456
- --tmp_table_size=1073741824
- --max_heap_table_size=1073741824
- --table_open_cache=20000
- --max_connections=1000
- --performance_schema
mem_limit: 21g
The issue we have is that the mysql container runs out of memory during some routine backup operations, namely mysqldump commands, and the container just crashes.
Basically the container's memory usage creeps up to the 21G over about a week of use, and I think can stay there if we do not launch any "big" operation, but if a mysqldump command is launched, at some point during the dump that just puts it over its allocated limit, and it crashes (it does not when we have not reached ~95% of memory usage earlier in the week).
I don't understand why MySQL does not manage its memory better and frees up some of it to launch the new commands it needs to execute ?
We tried putting the mysqldump commands in a different container, to try to "isolate" this big operation, but that does not seem to change anything, the bulk of the work is still done by the Mysql container which ultimately crashes when the other container performs the dump.
What should we look into? Are our settings just totally out of whack? We set them up after running a mysqltuner.pl, and I can do a new run if you think that's where the problem lies.
We have about 700 databases, with ~40 tables each, and maybe about 10 simultaneous mysql connections in average with some spikes at 30 or 50. DBs run between 10Mb and 200Mb in size.
Any help appreciated, thanks!
mysql memory containers mysqldump
We have a container running MariaDB, and a few other small containers on the host. The Mysql container was allocated 21G of memory (out of 32G total), as well as a few other parameters, with the following commands in the docker-compose:
db:
command:
- --innodb_buffer_pool_size=4294967296
- --query_cache_size=268435456
- --tmp_table_size=1073741824
- --max_heap_table_size=1073741824
- --table_open_cache=20000
- --max_connections=1000
- --performance_schema
mem_limit: 21g
The issue we have is that the mysql container runs out of memory during some routine backup operations, namely mysqldump commands, and the container just crashes.
Basically the container's memory usage creeps up to the 21G over about a week of use, and I think can stay there if we do not launch any "big" operation, but if a mysqldump command is launched, at some point during the dump that just puts it over its allocated limit, and it crashes (it does not when we have not reached ~95% of memory usage earlier in the week).
I don't understand why MySQL does not manage its memory better and frees up some of it to launch the new commands it needs to execute ?
We tried putting the mysqldump commands in a different container, to try to "isolate" this big operation, but that does not seem to change anything, the bulk of the work is still done by the Mysql container which ultimately crashes when the other container performs the dump.
What should we look into? Are our settings just totally out of whack? We set them up after running a mysqltuner.pl, and I can do a new run if you think that's where the problem lies.
We have about 700 databases, with ~40 tables each, and maybe about 10 simultaneous mysql connections in average with some spikes at 30 or 50. DBs run between 10Mb and 200Mb in size.
Any help appreciated, thanks!
mysql memory containers mysqldump
mysql memory containers mysqldump
asked Apr 29 at 11:31
HadrienHadrien
111
111
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago
add a comment |
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago
add a comment |
3 Answers
3
active
oldest
votes
Run mysqldump with the --quick option.
By default mysqldump tries to dump entire tables at once, meaning it must load the entire table into memory, and when memory is constrained mysqldump may fail. The --quick option switches to dumping by row, which is slightly slower and makes slightly larger dump files, but uses far less memory.
No, I do not know why they named the option --quick.
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
add a comment |
There is an article from Percona that may be helpful:
https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/
This passage seems Partially relevant:
The next thing when it comes to OS configuration is setting the Out Of
Memory killer. You may have seen a message like this in your kernel
log file:
Apr 24 02:43:18 db01 kernel: Out of memory: Kill process 22211
(mysqld) score 986 or sacrifice child
When MySQL itself is at fault, it’s a pretty rational thing to do.
However, it’s also possible the real problem was some of the batch
activities you’re running: scripts, backups, etc. In this case, you
probably want those processes to be terminated if the system does not
have enough memory rather than MySQL.
To make MySQL a less likely candidate to be killed by the OOM killer,
you can adjust the behavior to make MySQL less preferable with the
following:
echo '-800' > /proc/$(pidof mysqld)/oom_score_adj
This will make the Linux kernel prefer killing other heavy memory
consumers first.
========================================================================
Obviously you want to prioritize your mysqldump operation but if there are other processes using memory, you can kill processes any you feel are superfluous a higher priority for termination.
I am not sure how you are scripting your dumps. I am thinking it may help to break up your dumps into smaller batches groups (sets of table/database) to help keep memory getting to high. Just some thoughts on this.
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
add a comment |
If you don't want to give more memory to mysql, you can try setting replication server and do the mysqldump from there, problem is mysqldump is risky when your server having load. Please take a look performance related parameters which may also help https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-performance-options
Hope this will help.
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f965091%2fmysql-runs-out-of-memory-during-backup-dumps-docker-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Run mysqldump with the --quick option.
By default mysqldump tries to dump entire tables at once, meaning it must load the entire table into memory, and when memory is constrained mysqldump may fail. The --quick option switches to dumping by row, which is slightly slower and makes slightly larger dump files, but uses far less memory.
No, I do not know why they named the option --quick.
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
add a comment |
Run mysqldump with the --quick option.
By default mysqldump tries to dump entire tables at once, meaning it must load the entire table into memory, and when memory is constrained mysqldump may fail. The --quick option switches to dumping by row, which is slightly slower and makes slightly larger dump files, but uses far less memory.
No, I do not know why they named the option --quick.
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
add a comment |
Run mysqldump with the --quick option.
By default mysqldump tries to dump entire tables at once, meaning it must load the entire table into memory, and when memory is constrained mysqldump may fail. The --quick option switches to dumping by row, which is slightly slower and makes slightly larger dump files, but uses far less memory.
No, I do not know why they named the option --quick.
Run mysqldump with the --quick option.
By default mysqldump tries to dump entire tables at once, meaning it must load the entire table into memory, and when memory is constrained mysqldump may fail. The --quick option switches to dumping by row, which is slightly slower and makes slightly larger dump files, but uses far less memory.
No, I do not know why they named the option --quick.
answered Apr 29 at 16:56
Michael Hampton♦Michael Hampton
177k27322653
177k27322653
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
add a comment |
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
Thanks, I'm trying that, we'll see !
– Hadrien
2 days ago
add a comment |
There is an article from Percona that may be helpful:
https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/
This passage seems Partially relevant:
The next thing when it comes to OS configuration is setting the Out Of
Memory killer. You may have seen a message like this in your kernel
log file:
Apr 24 02:43:18 db01 kernel: Out of memory: Kill process 22211
(mysqld) score 986 or sacrifice child
When MySQL itself is at fault, it’s a pretty rational thing to do.
However, it’s also possible the real problem was some of the batch
activities you’re running: scripts, backups, etc. In this case, you
probably want those processes to be terminated if the system does not
have enough memory rather than MySQL.
To make MySQL a less likely candidate to be killed by the OOM killer,
you can adjust the behavior to make MySQL less preferable with the
following:
echo '-800' > /proc/$(pidof mysqld)/oom_score_adj
This will make the Linux kernel prefer killing other heavy memory
consumers first.
========================================================================
Obviously you want to prioritize your mysqldump operation but if there are other processes using memory, you can kill processes any you feel are superfluous a higher priority for termination.
I am not sure how you are scripting your dumps. I am thinking it may help to break up your dumps into smaller batches groups (sets of table/database) to help keep memory getting to high. Just some thoughts on this.
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
add a comment |
There is an article from Percona that may be helpful:
https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/
This passage seems Partially relevant:
The next thing when it comes to OS configuration is setting the Out Of
Memory killer. You may have seen a message like this in your kernel
log file:
Apr 24 02:43:18 db01 kernel: Out of memory: Kill process 22211
(mysqld) score 986 or sacrifice child
When MySQL itself is at fault, it’s a pretty rational thing to do.
However, it’s also possible the real problem was some of the batch
activities you’re running: scripts, backups, etc. In this case, you
probably want those processes to be terminated if the system does not
have enough memory rather than MySQL.
To make MySQL a less likely candidate to be killed by the OOM killer,
you can adjust the behavior to make MySQL less preferable with the
following:
echo '-800' > /proc/$(pidof mysqld)/oom_score_adj
This will make the Linux kernel prefer killing other heavy memory
consumers first.
========================================================================
Obviously you want to prioritize your mysqldump operation but if there are other processes using memory, you can kill processes any you feel are superfluous a higher priority for termination.
I am not sure how you are scripting your dumps. I am thinking it may help to break up your dumps into smaller batches groups (sets of table/database) to help keep memory getting to high. Just some thoughts on this.
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
add a comment |
There is an article from Percona that may be helpful:
https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/
This passage seems Partially relevant:
The next thing when it comes to OS configuration is setting the Out Of
Memory killer. You may have seen a message like this in your kernel
log file:
Apr 24 02:43:18 db01 kernel: Out of memory: Kill process 22211
(mysqld) score 986 or sacrifice child
When MySQL itself is at fault, it’s a pretty rational thing to do.
However, it’s also possible the real problem was some of the batch
activities you’re running: scripts, backups, etc. In this case, you
probably want those processes to be terminated if the system does not
have enough memory rather than MySQL.
To make MySQL a less likely candidate to be killed by the OOM killer,
you can adjust the behavior to make MySQL less preferable with the
following:
echo '-800' > /proc/$(pidof mysqld)/oom_score_adj
This will make the Linux kernel prefer killing other heavy memory
consumers first.
========================================================================
Obviously you want to prioritize your mysqldump operation but if there are other processes using memory, you can kill processes any you feel are superfluous a higher priority for termination.
I am not sure how you are scripting your dumps. I am thinking it may help to break up your dumps into smaller batches groups (sets of table/database) to help keep memory getting to high. Just some thoughts on this.
There is an article from Percona that may be helpful:
https://www.percona.com/blog/2016/05/03/best-practices-for-configuring-optimal-mysql-memory-usage/
This passage seems Partially relevant:
The next thing when it comes to OS configuration is setting the Out Of
Memory killer. You may have seen a message like this in your kernel
log file:
Apr 24 02:43:18 db01 kernel: Out of memory: Kill process 22211
(mysqld) score 986 or sacrifice child
When MySQL itself is at fault, it’s a pretty rational thing to do.
However, it’s also possible the real problem was some of the batch
activities you’re running: scripts, backups, etc. In this case, you
probably want those processes to be terminated if the system does not
have enough memory rather than MySQL.
To make MySQL a less likely candidate to be killed by the OOM killer,
you can adjust the behavior to make MySQL less preferable with the
following:
echo '-800' > /proc/$(pidof mysqld)/oom_score_adj
This will make the Linux kernel prefer killing other heavy memory
consumers first.
========================================================================
Obviously you want to prioritize your mysqldump operation but if there are other processes using memory, you can kill processes any you feel are superfluous a higher priority for termination.
I am not sure how you are scripting your dumps. I am thinking it may help to break up your dumps into smaller batches groups (sets of table/database) to help keep memory getting to high. Just some thoughts on this.
edited Apr 29 at 15:02
answered Apr 29 at 14:54
EvolutionaryEvolutionary
214
214
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
add a comment |
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
Yes makes sense, but 1. I'd rather solve the problem than having anything be killed. It just does not make sense for mysql to take on so much RAM that it won't be able to run some operations at some point, it should free up some of it when necessary. 2. It's all dockerized, I don't want/can't really set up the host to prioritize some processes manually. By definition the containers can be stopped, restarted, etc. the processes change and it needs to be host-agnostic.
– Hadrien
2 days ago
add a comment |
If you don't want to give more memory to mysql, you can try setting replication server and do the mysqldump from there, problem is mysqldump is risky when your server having load. Please take a look performance related parameters which may also help https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-performance-options
Hope this will help.
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
add a comment |
If you don't want to give more memory to mysql, you can try setting replication server and do the mysqldump from there, problem is mysqldump is risky when your server having load. Please take a look performance related parameters which may also help https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-performance-options
Hope this will help.
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
add a comment |
If you don't want to give more memory to mysql, you can try setting replication server and do the mysqldump from there, problem is mysqldump is risky when your server having load. Please take a look performance related parameters which may also help https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-performance-options
Hope this will help.
If you don't want to give more memory to mysql, you can try setting replication server and do the mysqldump from there, problem is mysqldump is risky when your server having load. Please take a look performance related parameters which may also help https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html#mysqldump-performance-options
Hope this will help.
answered Apr 29 at 16:37
asktyagiasktyagi
1156
1156
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
add a comment |
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
We do have some replication happening, and it's an interesting strategy to run the dumps on the replication server rather than the main machine. We'll explore that, but it has its limits since we do sometimes have problems with the replication, so we can't rely solely on this and I feel like we should have a way of making backups on the production database without having it crash when we do!
– Hadrien
2 days ago
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f965091%2fmysql-runs-out-of-memory-during-backup-dumps-docker-container%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
did you execute mysqldump inside the container or from docker exec? If you try to dump the database from remote client is append the same? (for remote client I mean connect from the network instead of sock)
– AtomiX84
Apr 29 at 13:38
Is it running out of RAM? Or disk? How big is the database?
– Rick James
May 2 at 1:33
The mysqldump was executed inside the DB container for a while, and now it is in its own container. No change from that. The execution is technically triggered from a remote client, and the dump is sent remotely as well, but it is still technically executed in a container on the local host. It's running out of RAM. Gz DB is ~500Mb
– Hadrien
2 days ago