I have a Digital Ocean server droplet running 2vCPUs and 2GBs RAM. I started with the 1vCPU 512 to build and have expanded it. The default mysqld.cnf have never been messed with and I have issues every now and then with it. I get the following message:
Out of memory: Kill process 1069 (mysqld) score 220 or sacrifice child
It then kills the process taking all my Wordpress sites down and is causing DB errors in my tables.
It also then states:
Killed process 1069 (mysqld) total-vm:1642480kB, anon-rss:448208kB, file-rss:0kB, shmem-rss:0kB
I am guessing by the numbers I have 1.5GBs of RAM free by the total-vm kB? is this correct or did it consume that much when it failed. Memory loads typically stay at the 39-43% on the droplet dashboard but they do spike hard during the Out of Memory message. The max on the CPU I ever see is around the 15% mark.
I have 4 Wordpress sites running on the server droplet and I am thinking that the config on the mysqld.cnf is wrong but I don’t know what I am doing. I am going to be increasing the server to 4GBs in less than a week as I am adding a 5th Wordpress site to the server but I figured I might want to address the memory issue first before launching another site.
My PHP settings for all installs are as follows:
PHP Memory Limit: 256 MB PHP Time Limit: 300 PHP Max Input Vars: 3500 MySQL Version: 5.7.29
What is enabled and disabled in the
key_buffer_size = 16M max_allowed_packet = 16M thread_stack = 192K thread_cache_size = 8 myisam-recover-options = BACKUP #max_connections = 100 #table_open_cache = 64 #thread_concurrency = 10 query_cache_limit = 1M query_cache_size = 16M expire_logs_days = 10 max_binlog_size = 100M
Thank you for any help on this before I increase stuff and possibly make it worst :)
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!