Skip to content

How I manage 6+ Million PageView Server at $6/month?

Learn how I manage the 6+ million pageviews a month blog backend performance and speed without compromising on user experience at only $6 a month.

It’s been a while I haven’t published anything interesting. Okay, it’s 0440 hours in local time. I woke up too early today and writing this post on how I manage a server that running a blog that garners 6+ million page views every month at only a nominal cost of $6 ($5 server + 1$ backup).

Yes, you read it right, it is just a $5/month starter cloud server from the DigitalOcean(DO).

I’ve been managing the DO cloud server since 2015 and it’s been an incredible learning experience. It’s been an ultimate rollercoaster ride when working with an unmanaged cloud server.

If you don’t know about DigitalOcean and how happy I have been, you can follow this post.

There are tonnes of things that come into play when completely managing a server, unlike managed cloud hosting you have to deal with every single issue on your own.

I had many sleepless nights and unlimited make-and-break trials of command-line that finally helped to create a server that can bare extensive peak load.

Before getting started, here is the sneak peek of DO billing —

DigitalOcean Billing for Nov 2019

and Google Analytics performance graph of for Nov 2019.

DigitBin GoogleAnalytics Nov 2019 Pageviews

Without further ado, let get started —

Backend Server Configuration

When I say ‘Server’, it’s completely the backend invisible part that host’s the site. Here are the configuration and specs of the cloud server running behind DigitBin:

Hardware Specs

It’s configured on the very basic standard droplet in DigitalOcean which is available at $5 per month.

  • CPU: virtual shared single-core (1 vCPU)
  • Memory: 1 GB RAM
  • Disk Space: 25 GB SSD
  • Bandwidth: 1 TB transfer
  • Location: NYC

I have also enabled the weekly droplet backup that additionally cost 20% of droplet cost, which is $1 for retaining 4 backups.

Software Specs

After multiple rounds of performance tweaks, I’ve now settled down to the below LEMP Stack configuration:

  • Operating System: Ubuntu 18.04 Server
  • Web server: Nginx
  • PHP version: 7.3 
  • SQL: MySQL 8.0 
  • Mail server: Postfix
  • Firewall: UFW

The server was initially created with the Apache2 web server (LAMP), however, a few years later we moved to Nginx (LEMP).

Now I am not going into detail about how I configured the software and hardware specs cause I already have a series of posts along with the video demos that you can refer to.

Cloud Server Setup

If you follow the guide carefully, I believe you will have the best and most secure server configuration to date.

Backend Performance Configuration

While basic server setup plays an important role in hosting and running the website, it’s performance tweaks that enhance the capability of the server.

I have tweaked every bit of the server configuration to make it powerful and sustainable at peak loads. For example;

Nginx Setup

I consider the Nginx to be the fastest when compared to the Apache webserver. It’s lightweight and has heavy processing capability.

To further improve its capabilities, I’ve added the snippets to execute browser caching headers, gzip compression, added security snippets, http2, and more. This will eliminate the reliance on third-party extensions in the front-end.

PHP Setup

PHP7.3 (will be migrating to 7.4) is the fastest PHP version compared to predecessors. I have enabled the capability of FPM (FastCGI Process Manager) for processing requests during heavy-load.

Installing PHP and supporting modules

This is also used for generating and serving the static html page from dynamic content using FastCGI nginx cache.

MySQL Setup

I use MySQL8.0 which is considered to be the fastest among predecessors (MySQL5.7) and likely has the capability of MariaDB.

Along with it also use the Redis Object Caching that helps in caching the complex and most requested queries within the RAM memory. Overall improving the processing speed and reducing the dependency on MySQL to process every request.

The cloud server setup guide covers hell lot of things that help in optimizing the overall server performance.

WordPress CMS Tweaks is running on the WordPress blogging CMS which has the rich capability and features to fully control, manage, and improve performance. Though I mostly rely on backend optimization, there are still a few minor tweaks that need to be made in the front end.

The WordPress itself is a pretty light-weight CMS that consumes a negligible memory and CPU for operating. But, things get clumsy when loaded with heavy memory intensive plugins.

Especially the caching and security plugins like W3 total cache, WP Supercache, Wordfence, etc. are pretty heavy on the server. Hence, I always look up for alternative which can be implemented in the backend. That’s where the FastCGI cache, nginx browser cache, redis object cache, UFW firewall, etc. act as a perfect substitute for the features these plugins are offering.

Always choose the plugins wisely. I add plugins if and only if there is no alternative or can’t be managed at the backend, like SEO plugins.

Offloading Static Assets

There are few static assets that often helps in loading and visualizing the site like, JS, CSS, Images, and HTML. Though HTML is an integral part of the front-end which cannot be offloaded completely, however, can be cached and distributed from the nearest edge caching server (more covered in CloudFlare CDN section below).

Free Images Offloading:

I am very thankful to WordPress for its very generous support that helped in offloading the images using photon CDN for free (clubbed into JetPack as Site Accelerator). If you do not know about photon and it’s API, you can read here.

With the Photon CDN, I’m able to save a few TBs of bandwidth against the images. Every image hosted on DigitBin is automatically synced and replaced with a photon CDN URL. Hence, saving the bandwidth cost and serving the image files from the photon’s edge caching server.

Apart from saving bandwidth, CDN also converts the image into webp format which is considered to be the superior lossless and lossy compression for images on the web.

Eventually, I am planning to migrate the images to CloudFlare CDN under sub-domains.

Offload CSS and JS:

CSS and JS are important assets that use for making front-end design attractive and interactive. I have (had) offloaded using plugins named commonWP and NGT jsDelivr. One can use either of the plugins to check which is compatible and working with your installation. However, I have used both interchangeably.

Both the plugins will rewrite the static CSS and JS asset URLs from the site to free open source CDN like JSDelivr. Example: will become This further reduces the bandwidth usage as well as server load.

However, there are certain conditions for rewriting the URLs. Like:

  1. The active theme and plugins must be from the WordPress repository.
  2. The developer should commit the files within /tags/ sub-directory folder (not in our control).

You can refer to the individual plugins details page for more such limitations.

[Note: I recently stopped using the jsdelivr since I wanted to combine JS & CSS assets and serve as a single file. Additional details in Cloudflare section]

Optimize Assets

Asset optimization is another important part that helps in improving server performance as well as improve this site loading speed.

Image Optimization:

As mentioned above, the Photon CDN automatically converts the image and compresses into webp format hence further optimization is not necessarily required. However, if you think you can improve loading time further, then you can of course compress the image file using API.

WP-Optimize Image Compression and Optimization

There is a dedicated plugin for, however, I use WP-Optimize plugins that not only incorporates the but also helps in the database cleanup.

CSS, JS and HTML Optimization:

WP-Optimize also has the feature to minify, cache, compress, and preload HTML, JS, and CSS as well. However, note that if you alter or make any changes to JS and CSS files, then free asset offloading using jsdelivr won’t work.

As far as HTML caching is consider, we already have the Nginx FastCGI caching in place that pretty much works without any additional caching plugin.

I recently started using the Autoptimize plugins for minification and combining assets. Though this has increased the server load a bit since it requires memory for processing, its totally worth it.

Cloudflare CDN Settings

So finally, here is the section that I have already mentioned twice above.

I used Cloudflare CDN a couple of years ago (I do not remember exactly but maybe in 2015), but my experience wasn’t great in those days. The site performance dropped and it also the loading became slow. Hence, immediately switch back to the original server and stayed.

But, recently a year ago I heard quite good reviews in terms of improved site speed and it’s fast DNS resolving capability. Hence, I thought of giving a try again.

I switched from Google DNS to Cloudflare DNS and made mandatory setup and started serving the files from Cloudflare Edge CDN caching.

I currently use the page rules, service workers, Cloudflare DNS for speed, SSL certificate, and minimal WAF security.

Cloudflare Page Rules

The Page Rules in Cloudflare is a pretty helpful feature that helps in setting up the site performance. It also accepts the wildcard parameter * that makes it every more robust.

I currently have these two rules which cache everything within the /content/ or /wp-content/ and /wp-includes/ directory and store in edge cache for 7 days.

The files that are minified and combined using the Autoptimze plugin are automatically served using the below page rules. Hence, there won’t be any additional bandwidth consumption from the cloud server.

DigitBin Cloudflare Page Rules

Edge caching helps in storing and sync the cached static files in the nearest edge server. When a user requests the webserver files, the Edge cache serves from the closest CDN pop datacenter. Making the site faster and smoother loading experience.

Cloudflare Service Worker

The Service worker was quite a new thing when I started using the Cloudflare again. The service worker helps in deploying the JavasSript worker on the Edge server that can control the website HTTP request.

I use a service worker to Cache Everything on the front-end part. This script helps in busting the cache when logged-in as a WordPress user.

The cache everything will help in edge caching the dynamic HTML in the Cloudflare server. So when the next web request is sent, Cloudflare automatically serves the HTML copy of the web page from the nearest CDN Edge server datacenter instead of hitting our original DigitalOcean cloud server.

This significantly reduces the server load and also makes the web serving extreme faster due to the Edge caching mechanism.

DigitBin Service Worker Rules

The service worker is chargeable. If you’re within the free tier limit, you won’t be charged a penny.

Security Settings

If you use the Let’s Encrypt free SSL certificate service, then you can skip this item. However, I moved to Cloudflare SSL and discounted the Let’s Encrypt. Cloudflare provides great options and controls to improve site security.

DigitBin SSL encryption mode

Cloudflare also has bot protection mode which is known as Web Application Firewall (WAF) that you can customize to any security level. I currently kept the Low mode since I have multiple crawler bots running on the site.

Note: Do not use the Cloudflare and Let’s Encrypt together. You may encounter the redirect loop error. Also, remove all the Let’s Encrypt rules that you might have added into the Nginx configuration file.

Bandwidth Served from Server

Since most of the static and dynamic assets are served using the Cloudflare and Photon CDN. The total bandwidth usage on the DO droplet is unsurprisingly low. Here are the stats of the DigitalOcean and Cloudflare server for last month:


Last month the Cloudflare CDN has helped me save 452 GB of bandwidth by serving all static assets (except Images) and cached HTML pages.

DigitBin Cloudflare Bandwidth Stats

Photon CDN:

The Photon CDN helps to save unlimited image bandwidth. I do not have exact counter, however, I am guessing the bandwidth to be anywhere near to ~20TB. DigitBin is an image-heavy site with the average size of an image being 100KB.

Photon CDN not only helps in saving the bandwidth but also reduces the server requests. Making CPU and RAM available for other important task intensive processes.

Eventually, I am planning to move the images into Cloudflare CDN hence making the site even faster.


After cutting off the bandwidth over to Cloudflare and Photon CDN, the DigitalOcean has only received limited bandwidth transfer requests — 22 GB per month.

DigitBin Droplet Transfer in Last Month

The data transfer size has increased on the DO droplet after installing the Autoptimize plugins and disabling the JSDelivr CDN plugins. Earlier it was less than 10GB (~8GB) per month.

Bottom Line: DigitBin Performance

So this was all about the server and website configuration of DigitBin that I currently manage at a nominal cost.

Though I have been charged additionally for Cloudflare service workers after crossing its graceful free limit. But, that almost negligible. These charges can be stopped if you do not use the service workers.

Overall I am pretty happy with the DigitalOcean server performance and free Cloudflare CDN as well as security setup.

I know you might have additional questions in your mind, feel free to drop in the comments below. Also. please drop any thoughts about my configuration or have suggestions.

Thank you! //Kushal

23 thoughts on “How I manage 6+ Million PageView Server at $6/month?”

  1. Hi
    I am also using DO with $5 droplet but I keep getting RAM issue. I have to restart mysql servers when I’m doing some backend work on website using putty ssh cmd : sudo systemctl start mysql

    I have just NO TRAFFIC right now. Still RAM issues. I used their WP Automatic Install to create Droplet instance.

    Please shed some light if you can on this issue.

      1. I installed it through the automatic wordpress installer in DigitalOcean. It is using Ubuntu. Not sure about the MySQL version but it must be latest as I installed it just a few months ago.

      2. I have noticed you use cdn for this website, for loading some part of js and css.
        may i know how you mapped cdn like this along with photon (which i too follow without jetpack) and jsdelvr.

        Thankyou in advance!

        1. Hi Sajeed, I use the BunnyCDN plugin to rewrite CSS & JS files from and CDN Enabler for Photon Images.

          PS: I have disabled Photon CDN for images, and using CDN Enabler for serving Image & JS/CSS CDN via Cloudflare service.

          1. How are you using Cloudflare to cache your static content on a subdomain rather than the actual root path of the website.

            I suupose you are using this workaround to save on Cloudflare worker resources as you’d not have to worry about caching logged in users with a subdomain in place.

            But unable to understand the setup here. I followed our CDN Enabler article to use as image cdn.

            I think you have found a better way to serve static content post that as you’re using now.

            Kindly share the updated method.


            1. Hi Vinayak, I’ve moved every static content over to rather than using photon CDN. All I did:
              1. Setting up the Sub-domain that is CNAME to root domain
              2. Updated the CDN URL in CDN Enabler to
              3. Added Page Rules in Cloudflare to “Cache Everything” any content matching*

              This setup helped me serving all static assets including the CSS, JS, and images from Cloudflare reducing the burden on my Original server.

              Yes – I did use the CF Service Workers to cache everything (ignoring sign-in user) but eventually discontinued it. As I am using the Nginx FastCGI Cache.

          2. So are you uploading all the static content (images, css, js) to

            Or is having a CNAME point to mean that will automatically point to and since the is using cache everything of CF, it will have CF cache it for the next time to serve through their edge servers?

            Or also if not that then, Nginx FastCGI Cache is another droplet which has pointed to it which caches everything static on and is proxied through CF for further edge caching.

            1. I am no longer using the CF “Cache Everything” for HTML caching. Earlier I had Edge cached but now discontinued. The CNAME is just for static assets (images, js, CSS) which is still set to Cache Everything under Page Rules.

              — No, I am not uploading on, but got the original URL rewrite with the CDN Enabler plugin.
              — Both, Nginx Cache and CDN are on same server within the same WordPress installation. I don’t want to complicate the process.

              1. My Bad. Thanks for taking out time to reply.

                I tried the process, as follows:
                1. Create a CNAME cdn aliasing root domain.
                2. In CDN Enabler added
                3. Added PageRule in CF for Cache Everything under

                But I’m probably missing something as it isn’t working actually.

                Also, I have OpenLiteSpeed Server on Ubuntu 20.04 now. Have caching plugins enabled.

                1. After adding the CDN Enabler, did the URLs for static assets have changed? Alternatively, you can use the BunnyCDN plugin. If nothing is working, then configure the wp-config.php to replace the content directory URL, you can find the steps in WP Official document.

              2. I think you have removed my comment in moderation as I’m not seeing it as pending approval.

                Anyway, thanks for previous articles.
                Will have to find my answers on some other tech enthusiasts portal.

                1. First, you have to rewrite the static file URL to serve from a sub-domain like Next, you can create the page rule “Cache Everything” for the subdomain to serve from Cloudflare.

                  1. what should i rewrite here

                    server {

                    # Multiple hostnames separated by spaces. Replace these as well.
                    server_name *; # Alternately: _

                    root /PATH/TO/WEBROOT;

                    index index.php index.html index.htm;

                    # static file 404’s aren’t logged and expires header is set to maximum age
                    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
                    access_log off;
                    expires max;

                    location ~ /\.ht {
                    deny all;

                    ps. got it from nginx to explain what Im asking

                  2. Hey Kushal, It’s amazing that you’re able to handle 6million visitors on a $5 droplet.
                    Can you please share a tutorial on how you have set up Cloudflare Service Worker as mentioned above?

                  3. Hi,
                    I really found your article useful but one problem i am not an IT guy and if you can help in layman terms for following matter:

                    I have just established a WordPress classified Ads website on ionos shared wordpress hosting. for improvement i have installed jetpack Image CDN that also now support css and JS i guess along with WP Super Cache. My hosting has 262,000 file limit plus 25000 monthly user limit. I dont know if my whole website (other than images) are on CDN or not as i am not an IT guy… I dont know i a worried like people will be accessing my shared server as only images are cdn i dot know what css or JS static means or include. Ifyou can guide whether with these settings all my site is cdn now and fast?

                    I am now looking for future plan. Please guide (as of present) what should the cheapest but fastest and secure option for image heavy sites (as everyone will be loading images) with respect to unlimited whole website CDN including images. i also dont want monthly visitor or number of files restriction? also easily manageable by me.
                    need your professional opinion and guidance. I am tired of reading article san articles and YouTube lectures and still wandering.

                    1. I would 100% recommend using a VPN server rather than a shared hosting server. You need to be a little technical for managing the server and site, but in long run, it’s totally worth it. If you are really thinking of scaling up the site and making a business out of it, switch to a good cloud VPS like DO, Vultr, etc. it will cost you very little for a starter plan compared to shared hosting else you can also consider Google Cloud free tier if you’re just setting up things.

Leave a Reply

Your email address will not be published.