Why does my MySQL Keep Crashing -- every 30 seconds on a 8gb 4 cpu droplet?

I’d like to avoid using swap per digital ocean’s recommendation not to do so. Can anyone tell me why this might be happening? Can anyone share a working .cnf file that is working on a LAMP droplet of this configuration?

I’ve checked tables for corruption, all OK

I’ve reinstalled the binaries. No Luck.

I’ve done a mysqldump, then dropped databases and restored from the .sql file, no luck.

I’ve read everything I’ve could and tried to tweak the .cnf settings. No luck.

This droplet is running the PHP and MySQL

Crash happens even when nothing is hitting apache


00:31:04 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.

It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 216106 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
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 = 0 thread_stack 0x20000
The manual page at contains
information that should help you find out what is causing the crash.

Then systemd restarts it:

2018-02-24T00:36:29.181273Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5120)
2018-02-24T00:36:29.182047Z 0 [Warning] Changed limits: max_connections: 214 (requested 1024)
2018-02-24T00:36:29.182053Z 0 [Warning] Changed limits: table_open_cache: 400 (requested 1280)
2018-02-24T00:36:29.342782Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.21-0ubuntu0.16.04.1) starting as process 5519 ...
2018-02-24T00:36:29.352247Z 0 [Note] InnoDB: PUNCH HOLE support available
2018-02-24T00:36:29.352301Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-02-24T00:36:29.352308Z 0 [Note] InnoDB: Uses event mutexes
2018-02-24T00:36:29.352312Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2018-02-24T00:36:29.352316Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-02-24T00:36:29.352320Z 0 [Note] InnoDB: Using Linux native AIO
2018-02-24T00:36:29.352618Z 0 [Note] InnoDB: Number of pools: 1
2018-02-24T00:36:29.352740Z 0 [Note] InnoDB: Using CPU crc32 instructions
2018-02-24T00:36:29.354406Z 0 [Note] InnoDB: Initializing buffer pool, total size = 2G, instances = 2, chunk size = 128M
2018-02-24T00:36:29.475425Z 0 [Note] InnoDB: Completed initialization of buffer pool
2018-02-24T00:36:29.491928Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2018-02-24T00:36:29.503809Z 0 [Note] InnoDB: Highest supported file format is Barracuda.
2018-02-24T00:36:29.514380Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 1749636249
2018-02-24T00:36:29.514445Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 1749636258
2018-02-24T00:36:29.514454Z 0 [Note] InnoDB: Database was not shutdown normally!
2018-02-24T00:36:29.514462Z 0 [Note] InnoDB: Starting crash recovery.
2018-02-24T00:36:29.655702Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2018-02-24T00:36:29.655743Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2018-02-24T00:36:29.655791Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2018-02-24T00:36:29.684600Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2018-02-24T00:36:29.685606Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active.
2018-02-24T00:36:29.685632Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active.
2018-02-24T00:36:29.686062Z 0 [Note] InnoDB: Waiting for purge to start
2018-02-24T00:36:29.736288Z 0 [Note] InnoDB: 5.7.21 started; log sequence number 1749636258
2018-02-24T00:36:29.736894Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2018-02-24T00:36:29.737195Z 0 [Note] Plugin 'FEDERATED' is disabled.
2018-02-24T00:36:29.740021Z 0 [Note] InnoDB: Buffer pool(s) load completed at 180224  0:36:29
2018-02-24T00:36:29.741704Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
2018-02-24T00:36:29.741730Z 0 [Note] Server hostname (bind-address): ''; port: 3306
2018-02-24T00:36:29.741740Z 0 [Note]   - '' resolves to '';
2018-02-24T00:36:29.741771Z 0 [Note] Server socket created on IP: ''.
2018-02-24T00:36:29.748874Z 0 [Note] Event Scheduler: Loaded 0 events
2018-02-24T00:36:29.749063Z 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.7.21-0ubuntu0.16.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
2018-02-24T00:36:30.186097Z 2 [Note] Access denied for user 'root'@'localhost' (using password: NO)

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This question was answered by @moisey:

Can you provide the output of the mysql check to see if databases are corrupted, as that could very potentially be the cause, with InnoDB it’s a bit of an in-depth process to get everything back up and running so want to make sure that corrupted database/tables are ruled out before going through great lengths to restore.

View the original comment