Server crashing / 2GB RAM / Wordpress

Centos 8.2 on the latest Virtual/web/usermin.

My server is crashing from time to time on a Digital Ocean 1CPU 2GB RAM instance. I just enabled fstrim and installed sysstat so I can see about when it’s getting high usage to figure out what’s happening and what’s killing it. I’d appreciate any pointers on this…what is WHM’s protocol on this? Maybe I can mimic it here. I’ve never had my server crash from resources on WHM. Appreciate the direction!

[root@dev admin]# systemctl list-unit-files
UNIT FILE STATE
proc-sys-fs-binfmt_misc.automount static
-.mount generated
dev-hugepages.mount static
dev-mqueue.mount static
proc-fs-nfsd.mount static
proc-sys-fs-binfmt_misc.mount static
sys-fs-fuse-connections.mount static
sys-kernel-config.mount static
sys-kernel-debug.mount static
tmp.mount masked
var-lib-nfs-rpc_pipefs.mount static
systemd-ask-password-console.path static
systemd-ask-password-wall.path static
session-3.scope transient
arp-ethers.service disabled
auditd.service enabled
auth-rpcgss-module.service static
autovt@.service enabled
certbot-renew.service static
chrony-dnssrv@.service static
chrony-wait.service disabled
chronyd.service enabled
clamav-freshclam.service disabled
clamd@.service disabled
clamonacc.service disabled
cloud-config.service enabled
cloud-final.service enabled
cloud-init-local.service enabled

Anything else useful I can provide? The official recommendation seems to be 2GB ram for Vmin running a Wordpress instance, so I’m figuring there is something I should be doing better. Free -m shows 800mb ram free currently…but something is happening and it’s spiking and crashing. I’m unsure…maybe it’s my backups or something?

I’d be interested in knowing what sort of Wordpress site you’re running. I’ve had issues on other servers (I have my own) where they put limits on PHP and MYSQL connections. Wordpress is pretty well known for being very heavy on both.

Just a quick Google showed me this from Digital Ocean:

MySQL nodes can have up to 75 simultaneous connections per gigabyte of usable memory, rounded down to the nearest gigabyte. Usable memory is the total memory on the node minus approximately 350 MB of overhead for the operating system and management.

So according to that, you have actually 1.65 gigabytes rounded down to 1.6.

If my interpretation of that documentation is right, that limits you to 120 connections to MYSQL. That’s not a whole lot when you’re running a Wordpress site.

I would start looking at your reports to see if you’re hitting the MYSQL limit.

EDIT TO ADD: It may even round down to 1 gig, that would limit you to 75 connections. Wordpress with nothing but bots on it can rack that up in a hurry.

This is great to know, thank you! I’m now logging system resources and I upped the system to 4GB RAM for now. I’ll keep an eye on it. Thanks for your reply. :slight_smile:

Are you familiar if AWS does something similar to this in regard to MySQL connections per GB/RAM? I’ve been considering switching to learn their systems.

Here are a couple of links with the info.

https://sysadminxpert.com/aws-rds-max-connections-limit/

What do you mean by “crashing”?

My website would not load…I can’t remember if it was a 404 or 500, but I believe it was a 500. I’d have to hop in and restart webmin every time it happened…about once every month or so. No issues since I upped my server to 4GB.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.