[MDEV-11309] MariaDB server restarts every night (at least, sometimes more) for no apparent reason Created: 2016-11-18 Updated: 2017-01-16 Resolved: 2017-01-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | OTHER |
| Affects Version/s: | 10.1.19 |
| Fix Version/s: | 10.1.21 |
| Type: | Bug | Priority: | Major |
| Reporter: | Rafael Gallastegui | Assignee: | Sergei Golubchik |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
CentOS 6.8 VM 16GB memory. |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Every night (sometimes even during the day), we get a restart of the MariaDB server (Master in a master/slave replication pair). Only messages in the log are:
followed by the usual start sequence. Nothing before it that it indicates errors or so |
| Comments |
| Comment by Elena Stepanova [ 2016-11-18 ] | ||||||||||
|
Please check you system logs for messages from OOM killer. If mysqld process disappears without saying anything at all in the log, it's almost always caused by OOM. | ||||||||||
| Comment by Rafael Gallastegui [ 2016-11-20 ] | ||||||||||
|
Elena, Thanks for the quick response. That was the issue. I'm investigating what settings to change to reduce the memory usage. I guess this JIRA can be closed based on that | ||||||||||
| Comment by Elena Stepanova [ 2016-11-20 ] | ||||||||||
|
Thanks for the update. I'm closing it for now, but please comment to re-open if during your investigation you find out that MariaDB might have a memory leak. | ||||||||||
| Comment by Rafael Gallastegui [ 2016-12-01 ] | ||||||||||
|
Hi, I'm attaching the output of a tool that does the following every minute:
The file contains the data in between 2 crashes due to OOM Reducing the innodb_buffer_pool_size from 12G to 10G helped a little bit but I'm still running out of memory
(I figure that our problem might be related to the number of tables, that's why I mention all those changes) This server is the master to a rep server that has 32GB in memory (I know that replication runs into issues, but was waiting for the master to stabilize. Don't know if the rep process of the slave might affect the server). Thanks for the help! | ||||||||||
| Comment by Rafael Gallastegui [ 2016-12-05 ] | ||||||||||
|
Another clue:
| ||||||||||
| Comment by Elena Stepanova [ 2016-12-05 ] | ||||||||||
|
In this case, maybe you could try reducing table_open_cache which is currently set to a quite big value of 150000. | ||||||||||
| Comment by Rafael Gallastegui [ 2016-12-06 ] | ||||||||||
|
I have reduced the table_open_cache to 50000 and have been monitoring the system since yesterday. Is there a way to calculate ahead of time how much memory will MariaDB use as a maximum? I mean, it's kind of hard to know what value to use for some parameters, including table_open_cache, just by trial and error, especially in a production environment. table_open_cache could take days to crawl up until the system runs out of memory. I guess I'm concerned that I report to my management that the issue has been solved and find out later on that I get an OOM because another parameter pushed MariaDB to use more memory. | ||||||||||
| Comment by Rafael Gallastegui [ 2016-12-06 ] | ||||||||||
|
By the way, we appreciate the time you've spent helping us! | ||||||||||
| Comment by Sergei Golubchik [ 2017-01-16 ] | ||||||||||
|
In |