Wordpress running slow & gets down on traffic spike (stress test)

ASghostKI

Verified User
Joined
Oct 30, 2020
Messages
30
Hello,

I have a BuyVM server (RYZEN KVM 2GB) running DirectAdmin v1.63.9 on debian10_amd64.
I got like 4 domains on that Directadmin but all of them get little to no traffic at all;
Currently I'm launching an e-commerce website so I got a fresh WordPress 6 install with WooCommerce + some plugins that goes with it (site info)

While setting up the website I noticed that it's kinda slow but went on with it untill now I wanted to stress test it using (loader.io) and it goes down on every test it stays down for a while and it goes back up; here is a screenshot of my HTOP result while running the test
I'm not sure if it's just my servers perf or maybe something that isn't setup as it should

Hopefully I get some input from you guys
 
You need more RAM, you have exhausted your RAM and are using lots of swap (which is really slow). 2GB is not really enough for a loaded web server running multiple WordPress sites, especially with Woo-commerce. Absolute minimum I would say 4GB RAM with what your doing, would be better with 8GB to leave some breathing room allowing for system caches. Should also use a WordPress cache plugin, with Apache+Nginx I use 'W3 Total Cache' seems to do a good job, or Litespeed and LitespeedCache.

And you need to adjust your WordPress memory limit if your running Woo-commerce.


Create or edit a .user.ini in your web root and add something like:

Code:
memory_limit = 512M
post_max_size = 100M
upload_max_filesize = 100M

And with more RAM I would adjust swapiness to 1.

 
Recommend for running multiple Website And Handle some DDOS Attack should be atleast 8GB

2GB will easy DDOS, even firewall can't protect your server.
 
Add more ram/cpu, but also try installing a plugin like wp super cache, works for me (brought speed up from 4 requests/sec to like 60/sec on my personal box with 1c/1gb ram)
 
I did some testing
On my vps with 1c/1gb ram, with apache:
avg of 264 requests/second on static content
avg of 62 requests/second on wordpress with caching (small site, no plugins except caching and classic editor)
avg of 4.3 requests/second on wordpress without caching (small site, no plugins except classic editor)

For static content, cpu is the bottleneck (264/sec on 1 core isn't bad imho)
for wordpress, it's a mix, both cpu and ram where pretty full.
(I supose if you can set up mod_cache in apache, or use nginx_apache and use caching in nginx, you might be able to push wordpress to the 200+ requests/second)
 
@k1l0b1t
Static sites will always have the best performance and lowest overhead. Unfortunately many want to use WordPress even for static sites that have no dynamic content. I never build a production web server anymore with less than 32GB of RAM.

@ASghostKI
Mentioned that they want to run WordPress WooCommerce plugin, which will also need more resources than the default configuration.
 
If / when you increase the size of that server, read up on topics like database tuning. You have max connections set at 151, which is way to high for 2 gigs. Even with 8 gigs of RAM it would be closer to 90 connections.
 
Back
Top