I already installed NGINX, PHP-FPM, MYSQL and Wordpress in Ubuntu 18.04 . Also, I have Let’s Encrypt SSL . Even i use Cloudflare CDN on the top of my domain.
And to improve my site load performance even more, now i want to install Varnish on my NGINX server. How can i do it? And whether it’ll be worth it or not?
Thanks in advance! :)
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Since you already have CloudFlare in front of your web site, Varnish likely won’t provide a significant performance boost, since CF already offloads all static assets across their CDN edges and delivers them to your end users (in almost the same way as DigitalOcean Spaces would). It’d make sense to install Varnish if you had a high traffic web site with several thousand visitors per day, since it comes with a lot of advanced features that could help you in that case. If I understand correctly, you have a single droplet with the usual LEMP stack with CloudFlare on top of it, which is more than enough for your current needs.
Instead, what I recommend you install instead is Redis. Although PHP 7 & PHP-FPM in Ubuntu 18.04 come with sensible defaults when it comes to OP cache and performance in general, adding Redis to your stack can provide an additional speed bump. Just make sure you configure Redis as a non-persistent cache and assign at least 256 MB of RAM for it (you don’t want it to hit the disk) and then install Redis Object Cache plugin for WordPress so that your WP instance can talk to Redis cache and vice versa. Going through Redis & WordPress documentation should be enough for you to figure out how to do this, and if you do get stuck, a few Google searches will likely point you in the right direction.
Also, keep in mind that Ubuntu 18.04 and newer ships with MySQL 8 which tends to use more system resources than previous versions by default. In my experience, the default configuration isn’t the most optimal since version 8 is still relatively new and there aren’t many production scenarios we could refer to for best practices yet, so another thing I’d suggest you try is the famous MySQL Tuner script after a few days of MySQL running on your droplet. It will analyze the overall performance of your MySQL instance and will provide performance optimization suggestions you can implement right away to further optimize MySQL on your droplet.
Hope this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.