I just want to preface this with the fact I am new to server admin work like this, but am very interested and eager to learn. I'm hosting a small WordPress site on Digital Ocean, the site is relatively new and has little to no traffic. The droplet is running a typical LAMP stack and has 1GB memory, which in my experience has been sufficient in the past as I tend to not use a lot of plugins and use fairly light themes. The only plugin I installed that I haven't used before is WordFence. Anyways, during development, I occasionally get an error that reads "Error establishing connection to the DB", sometimes the site will not load at all and connecting via SSH is super sluggish. Today I experienced the issue and after it resolved itself, I SSH'd in to see what I can find. Below is what I was able to gather:
top
constantly list mysql up top as it's usage is high
1724 mysql 20 0 1333488 405436 0 S 0.7 40.5 0:11.53 mysqld
grep -Ei 'oom|out of memory' /var/log/syslog
Jan 25 15:18:40 droplet kernel: [599977.961722] oom_kill_process.cold+0xb/0x10
Jan 25 15:18:40 droplet kernel: [599977.961936] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
Jan 25 15:18:40 droplet kernel: [599977.962031] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/mysql.service,task=mysqld,pid=31337,uid=112
Jan 25 15:18:40 droplet kernel: [599977.962130] Out of memory: Killed process 31337 (mysqld) total-vm:1342776kB, anon-rss:439804kB, file-rss:0kB, shmem-rss:0kB, UID:112 pgtables:1264kB oom_score_adj:0
Jan 25 15:18:40 droplet kernel: [599978.039990] oom_reaper: reaped process 31337 (mysqld), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Jan 25 15:26:50 droplet kernel: [600468.028506] systemd invoked oom-killer: gfp_mask=0x100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
Jan 25 15:26:50 droplet kernel: [600468.028534] oom_kill_process.cold+0xb/0x10
Jan 25 15:26:50 droplet kernel: [600468.028658] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name
Jan 25 15:26:50 droplet kernel: [600468.028754] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/system.slice/mysql.service,task=mysqld,pid=67924,uid=112
Jan 25 15:26:50 droplet kernel: [600468.028885] Out of memory: Killed process 67924 (mysqld) total-vm:1310584kB, anon-rss:385228kB, file-rss:0kB, shmem-rss:0kB, UID:112 pgtables:1132kB oom_score_adj:0
Jan 25 15:26:50 droplet kernel: [600468.092875] oom_reaper: reaped process 67924 (mysqld), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
Being new to this, I'm unsure if this is of concern (possibly an attack of some sort) or if it's simply a configuration Digital Ocean's 1-click WordPress install does or possibly that 1GB of memory isn't enough anymore. Any insights would be greatly appreciated!