I have a 1GB RAM droplet with a single Wordpress site on it on Apache. It gets no visitors.
Uploading images through the WP media uploader will crash MySQL. This is more likely if I upload more images. Rebooting the server is required to fix things again. Nothing else causes the server to crash.
I was thinking it could be to do with a lack of RAM but I run another website on a 1GB droplet with Ubuntu 16.04 and don’t get this issue. Does 20.04 perform worse with Wordpress?
If I run top I normally have 65 “free” and 100-200 “available Mem”.
When the crash occurs, MySQL error log prints:
2021-01-10T00:53:30.767263Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-01-10T00:53:30.767531Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-01-10T00:53:30.807432Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.22-0ubuntu0.20.04.3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu).
2021-01-10T00:53:34.140376Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22-0ubuntu0.20.04.3) starting as process 18098
2021-01-10T00:53:34.154228Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-10T00:53:34.778531Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-01-10T00:53:35.239850Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2021-01-10T00:53:35.594495Z 0 [System] [MY-010229] [Server] Starting XA crash recovery...
2021-01-10T00:53:35.630346Z 0 [System] [MY-010232] [Server] XA crash recovery finished.
2021-01-10T00:53:47.286121Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2021-01-10T00:53:47.286781Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2021-01-10T00:53:47.338498Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.0.22-0ubuntu0.20.04.3' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu).
2021-01-10T00:53:58.940189Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22-0ubuntu0.20.04.3) starting as process 18166
2021-01-10T00:53:59.023721Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-10T00:54:16.018441Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.22-0ubuntu0.20.04.3) starting as process 18204
2021-01-10T00:54:16.089162Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-01-10T00:54:52.357857Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
Apache error log doesn’t contain anything to do with the issue.
I have tried:
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.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello, @umpire
I will definatelly recommend you to add a swap file if you haven’t done this yet and also use the MySQL tuner script and see if the MySQL configuration needs an improvement.
You can also create a simple bash script to check if MySQL is running and if not to restart it.
Run this script every 5 minutes using a cron job like this one:
Hope that this helps! Regards, Alex
Hi there @umpire,
It is possible that the PHP
max_memory
is set too high or the MySQL settings might need to be tweaked.I could suggest the following things:
Let me know how it goes. Regards, Bobby