Since Google has been providing the improved model of their “Always Free” tier, internet hosting web site on their cloud platform appears to be a compelling choice. Particularly for small web sites or blogs with low site visitors that keep beneath free tier quota may find yourself paying nothing in any respect. However with appropriate cache and CDN setup, you can too deal with an unimaginable quantity of site visitors utilizing simply the free tier occasion, f1-micro (this web site for instance) Let’s test it out on this publish!
Google All the time Free Tier
The one occasion that eligible for Google All the time free tier is f1-micro which has 0.2 vCPU and 0.6GB RAM. With this quantity, you’ll be able to solely host weblog or static content material and neglect about CPU/Database intensive web site like discussion board or e-commerce.
Google can be beneficiant sufficient to supply a burst functionality that can help you make the most of all the vCPU for a brief interval (similar as having 1 vCPU) So you’ll be able to nonetheless deal with a handful of concurrent guests if wanted. The burst lasted round 30 second which you’ll see the CPU utilization chart go above 100% like this.
The Net Server
Many individuals often go together with LAMP stack (Linux + Apache + MySQL + PHP) for WordPress web site. It’s comprehensible however since our useful resource is proscribed, you may need to take a look at various substitute that’s extra environment friendly for static web site like Nginx or OpenLiteSpeed.
For this web site, I attempted OpenLiteSpeed which boast a number of instances sooner efficiency than Apache with much less CPU/RAM utilization. There’s a good stress check evaluating between OpenLiteSpeed vs Nginx which may assist your determination.
Cache and CDN Setup
Since we’re internet hosting a static content material web site, Cache and CDN setup may scale back our load drastically. Cloudflare and good WP Cache plugin (e.g. WP Rocket, WP Quickest Cache) In my case, I acquired 70% discount of incoming requests (from 1.4 million to 412K requests) This implies with Cloudflare, our f1-micro occasion can deal with round 3x extra site visitors!
Growing Reminiscence utilizing Swap
Keep in mind that f1-micro solely has 0.6GB RAM (581MB to be actual) So we’ll have to allocate a swap file, simply in case we ran out of reminiscence. You are able to do that simply with these command beneath.
sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /and many others/fstab
Now you’ll have 1GB swap file prepared. Even you have already got a lot RAM obtainable, it’s nonetheless helpful to have swap
At the moment redstapler.co has round 137K pageviews/month (round 100K distinctive guests)
And beneath is the each day CPU and RAM utilization chart
You’ll see that’s solely round 20% CPU utilization whereas RAM utilization was steady at round 50% which suggests we are able to push much more site visitors on this occasion. (The very best spike was after I revealed the brand new publish and acquired many concurrent guests) So now the one value for internet hosting web site on Google Cloud is the community bandwidth utilization (was drastically decreased by Cloudflare) which is round $1.5/month. That’s even cheaper than a lowest shared internet hosting plan!!!
As you’ll be able to see, with the proper WordPress cache plugin setup, utilizing Cloudflare CDN to scale back load, activate swap and utilizing a superb net server, a tiny f1-micro can simply deal with 100K-200K distinctive guests/month for static web site with none concern. Personally, I imagine we are able to even push it to 500K guests/month. Anyway, I’ll replace this publish once more later if our web site has reached that state 🙂
Replace: I made an article about value breakdown of internet hosting web site on Google Cloud. Simply in case you may need to test it out!