Zero Scale WordPress
Zero Scale WordPress in English
Overview
[Cost Savings] Run WordPress Smartly! Achieving Ultimate Zero Scale with Cloud Run
This demo site called Zero Scale WordPress, so please feel free to check it out. Please note that the very first connection may take about a minute, but after that, it will work smoothly. This initial delay is due to the time required for the database to start up. Japanese ver: Zero Scale WordPress | zero-wp: Zero scale WordPress
Is your WordPress site racking up server costs even when there’s no traffic? For personal blogs or small-scale sites, database maintenance fees can be a surprising burden, right? Have you ever thought, “What if there was a system where I only pay for WordPress when it’s actually being used?"
Well, good news for those of you with such concerns! 🎉
In this article, we’ll introduce the “Zero Scale WordPress" project, a groundbreaking mechanism to bring your WordPress operational costs as close to zero as possible. Using Google Cloud’s cutting-edge technology, we’ll thoroughly explain how to realize a WordPress environment where “you don’t pay when you don’t use it!"
But actually, this isn’t just limited to WordPress. It’s a concept applicable to other frameworks and CMSs like Zero Scale Rails or Zero Scale Laravel. In other words, what we have here is a new approach to using server resources efficiently.
The technical key to this method is using Cloud Run’s “Startup Probe" to launch necessary components (like a database) on-demand and automatically stop them when there’s no access. This eliminates the need for the WordPress database to be constantly running, significantly reducing costs.
What’s So Amazing About “Zero Scale WordPress"?
The biggest appeal, by far, is the dramatic cost-saving effect!
Normally, to run WordPress, you need to keep a database server like MySQL constantly running separately from the web server, and this becomes a fixed cost.
However, with “Zero Scale WordPress," when there’s no access to the WordPress container (web server), the database server (a Google Compute Engine VM instance) is automatically stopped. When access resumes, it starts up instantly, allowing WordPress to operate normally.
For example, based on estimates from May 2025, a database instance that would cost around $3.50/month (T2D Spot instance $3.10 + standard persistent disk $0.40, excluding backup costs) even if running continuously, could potentially be operated even more cheaply if successfully stopped using this mechanism. It’s truly a dream-like system that gets you closer to pay-as-you-go.
Additionally, there are other benefits:
- Efficient Resource Utilization: Since resources are only used when needed, it suppresses wasteful power consumption, making it gentle on your wallet and the environment!
- High Scalability: Being based on Google Cloud Run, it can automatically scale to handle sudden increases in traffic.
How Is It Achieved? The Magic Behind “Zero Scale"
Here are the main technologies and mechanisms that realize this “zero scale":
WordPress on Cloud Run
First, WordPress itself runs on Google Cloud’s serverless container execution environment, Cloud Run. This means that when there’s no access, the container count can go to zero, incurring no costs.
On-Demand Database Startup (Startup Probe)
This utilizes a Cloud Run feature called the “Startup Probe."
When the WordPress container starts, it first attempts to connect to the database (in this case, a MySQL server on Google Compute Engine).
If it can’t connect (meaning the DB is stopped), a script automatically starts the Compute Engine instance!
Once the DB successfully starts and connects, WordPress also begins to operate normally.
By the way, we chose Compute Engine over Cloud SQL for a practical reason: instance startup was faster. While the same principle could work with Cloud SQL, startup times might be longer.
Automatic Database Shutdown (Monitoring & Pub/Sub & Cloud Functions)
Google Cloud Monitoring detects when the number of Cloud Run container instances becomes zero (meaning there’s no more access).
After a certain period of no access (e.g., 10 minutes), a notification is sent to a messaging service called Pub/Sub.
This notification triggers a small function prepared in Cloud Functions, which then automatically stops the Compute Engine instance (MySQL server).
Data is Securely Persisted
WordPress post data and settings are saved on the Compute Engine’s persistent disk.
Uploaded files like images (wp-content/uploads) are stored in Cloud Storage and mounted by Cloud Run, so data is safe even when the container stops.
Modern Configuration Management
WordPress core version control, as well as theme and plugin management, is handled using Composer, realizing a modern and efficient development and operational flow.
By linking these mechanisms, the ideal WordPress environment—one that “starts only when needed and stops when not"—is completed.
Looking at the following architecture diagram should give you a better image of the overall flow.
Experience “Zero Scale WordPress"!
If you’re thinking, “I want to try this myself!" that’s fantastic. All the detailed configuration files and scripts to realize this “Zero Scale WordPress" are publicly available in the following GitHub repository:
Zero Scale WordPress – GitHub Repositoryhttps://github.com/takotakot/zeroscale-wp
The README.md file in the repository contains even more detailed technical information.
What you’ll need (roughly):
- A Google Cloud account
- Basic knowledge of Docker and containers
- The
gcloudcommand-line tool
Main configuration points:
- Cloud Storage Bucket Configuration: Preparing buckets to store WordPress core files, themes, plugins, and uploaded files.
- Cloud Build Configuration: Setting up
cloudbuild.yamlto automate Docker image building and deployment. - Cloud Run Configuration: Setting environment variables (like database connection info) and the aforementioned Startup Probe (
startup_gce.php). - Cloud Functions Configuration: Deploying the function that stops the Compute Engine instance.
Setup requires a certain level of technical knowledge, but this mechanism, with its potential for dramatic cost reduction, is well worth the challenge.
Conclusion: A New Form of WordPress Operation
“Zero Scale WordPress" proposes a new style of WordPress operation that overturns conventional wisdom.
- Overwhelming cost benefits
- Efficient use of resources
- Utilization of serverless technology
From personal blogs to small-scale business sites, this project could be a great boon for many WordPress users.
Please check out the GitHub repository and experience the future of WordPress operation. And if you do try it, we’d be delighted if you could provide feedback, impressions, or suggestions for improvement via comments or GitHub Issues!
May your WordPress life become more comfortable and economical!


ディスカッション
コメント一覧
まだ、コメントがありません