HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

MySQL crashing at about 70k open files

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
70kcrashingopenmysqlfilesabout

Problem

Server running community 8.0.14, we hit the number of open files a few days ago, so I increased the limit but after a while the server crashed with this in the error log:

```
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
03:07:21 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
Attempting to collect some information that could help diagnose the problem.
As this is a crash and something is definitely wrong, the information
collection process might fail.

key_buffer_size=8388608
read_buffer_size=131072
max_used_connections=221
max_threads=1000
thread_count=4
connection_count=3
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 403301 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f9200000b20
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 7fd571ceaca0 thread_stack 0x46000
/usr/sbin/mysqld(my_print_stacktrace(unsigned char*, unsigned long)+0x3d) [0x561bdb69757d]
/usr/sbin/mysqld(handle_fatal_signal+0x423) [0x561bda8277c3]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x12890) [0x7fe5095f6890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7) [0x7fe507981e97]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x141) [0x7fe507983801]
/usr/sbin/mysqld(ut_dbg_assertion_failed(char const, char const, u

Solution

The issue is a Mysql bug (https://bugs.mysql.com/bug.php?id=94185 )

Anyway, some tuning mitigated the issue and stopped the number of open files to grow.

Specifically, we set:

innodb_lru_scan_depth=100
innodb_flushing_avg_loops=5
thread_cache_size=216


Fixed as of the upcoming 8.0.16 release, and here's the changelog
entry:

Static thread local variables defined at the wrong scope were not
released at thread exit.

Code Snippets

innodb_lru_scan_depth=100
innodb_flushing_avg_loops=5
thread_cache_size=216

Context

StackExchange Database Administrators Q#228403, answer score: 6

Revisions (0)

No revisions yet.