Can anyone suggest Droplet setup for Wordpress news site with high traffic?

September 23, 2018 1.8k views
Initial Server Setup WordPress PHP Apache Caching MySQL

Hello all,

First off, You’re amazing and awesome for helping the community! Thanks.

I don’t have much knowledge with servers and i’ve only learned the setup and how things work by myself using the community and guides here. Hope you can help and guide me on this next venture!

Currently I have an old droplet on DO that was set up about 2 years ago.
It was orignally set up with Ubuntu 14.04 and LAMP.
versions for everything are not up to date.

Lately I’ve been testing out one of the sites on the droplet and growing the traffic massively.
This was $5 droplet and when it started growing with few hundreds concurrent users I have resized it to $15.
Reaching to 1000~1500 concurrent users I kept resizing to a $40 server.
The site kept getting chuked/slow/crash when it reached to about 3,000 concurrent users so I thought I might need some better configuration.

A lot of mess started at this point when a friend tried to help optimize - installed cloudflare, adjusted some settings and caching in various places (server down/ fixing problems/ big mess) until it got back working I noticed its not capable to hold even 3,000 concurrent as before.

I’ve read more guides and tips and installed ngnix and php7 (was php5) instead of apache which I deleted at that point.
Played out with copy pastting of many configurations file for ngnix, php-fpm5 (which I kept seeing in processes), php 7 and more…
The site is more stable now but still crashes from time to time, the php-fpm is showing 300~500% usage over cpu and memory is reaching max as well. sometimes I even get database connection fails and mysql drops down.

*TOO LONG DIDNT READ - start here *

If it was too much to read my previous path with old server this is in short what I need:

I am looking to setup a fresh droplet/setup for a wordpress website and plan it well to hold 10,000 concurrent users and later even more.

Please advise what are the steps to take in order to get this mission going well, if possible please attach guides as i’m not very experience with servers yet.
I thought to follow this guide - How To Configure Nginx as a Web Server and Reverse Proxy for Apache on One Ubuntu 18.04 Server
and hope that from there it’s easier to tweak just few settings along with cdn, cache plugin (wp-rocket) and maybe cloudflare (any value to that?)

Hope you can help!

3 Answers

Hi Yarino,

Glad you’re finding success with your website. If I were you, I would get professional help at this point. Those tutorials only covers about 10% of the server setup. You’re left exposed and vulnerable with them.

To answer your question,

I wouldn’t go Reverse Proxy route. Nginx is perfectly capable of handling WordPress. What you need to do is optimize. I’m not gonna get into how. There are lots of tutorial out there.

Performance

Since you’re already using wp-rocket, you can configure rocket-nginx. It serves cached wp-rocket cached files to visitors without even touching WordPress or PHP. Resulting on massive performance boost. Most of your pages will be served as static html files to the browser. The plugin Autoptimize goes well with wp-rocket. I use that combination for caching.

I would also install Redis for database caching. There’s WordPress plugin for that too.

I would also enable PHP Opcache with file caching.

That should take care of the caching. This setup makes updating WordPress plugins a real pain. But it’s worth it.

I’ll also look into hosting database off the server. I use Amazon RDB for that. But that’s not required though.

Above setup will require you to set up real cron jobs for WordPress since WordPress won’t be touched 90% of the time.

I don’t know if you’re using a security plugin, but if you do, it probably eats up large part of your system resources. You should look in to minimizing usage of PHP when you can. And these security plugins doesn’t help with that. ModSecurity with UFW and Fail2Ban is the ideal solution for Security. You can add real-time malware scanning with Linux Malware Detect.

Hope this helps. My contact details are in the profile page if you want to reach me.

Hey friend!

That was a great answer by @vpsfix, and I’ll merely throw mine into this as well for good measure. I answered a similar question the other day, and it might make for a relevant read: https://www.digitalocean.com/community/questions/how-many-page-views-per-day-can-a-server-with-1-gb-ram-can-take-with-3-5-mb-as-and-average-page-size?answer=45790

If I had to suggest an easy stack for Wordpress that I felt was most likely to make up for WP optimization issues, this would be my personal choice:

https://easyengine.io/

With that said, it’s just the best effort for an easy attempt. There are no guarantees that your website can even run as well as you hope on any stack or hardware, it is absolutely possible to modify Wordpress with plugins and themes in a way that simply cannot perform reasonably.

Jarland

Hi @vpsfix, @jarland ,

Thank you very much for your help with guidance and details about how to get things working!
I’ll look into the solutions you’ve provided closely.

Have another answer? Share your knowledge.