Horizontal Scaling
Horizontal Scaling allows your Frappe Cloud server to automatically add a secondary application server during periods of high traffic. Instead of upgrading to a larger server, the workload is shared between two identical servers to improve performance without downtime.
Horizontal Scaling is currently available only for Dedicated Servers and is in Beta for the Mumbai region.
How Horizontal Scaling Works
Under normal traffic, your sites run only on the primary application server. When server load increases beyond configured limits, Frappe Cloud automatically starts a secondary application server that runs the same benches and begins sharing incoming requests.
Once traffic returns to normal, the secondary server is gracefully removed and all requests are routed back to the primary server.
Why Use a Secondary Server?
The secondary server provides additional compute resources only when required.
- Handles spikes in HTTP requests and API traffic.
- Processes workloads alongside the primary server.
- Helps maintain application responsiveness during peak usage.
- Scales down automatically when demand decreases.
Set Up a Secondary Server
- Open your Server Dashboard.
- Navigate to Server Actions.
- Select Setup Secondary Server.
- Choose the server plan for the secondary server.
- Complete the setup process.
The secondary server uses the same compute configuration as the primary server to ensure consistent performance during scaling.
Scaling Up
When configured thresholds are reached, Frappe Cloud automatically starts the secondary server and distributes incoming traffic between both servers.
- The secondary server launches in the background.
- Benches are synchronized with the primary server.
- Traffic is automatically balanced between both servers.
Since both servers have identical compute capacity, approximately 50% of incoming requests are routed to the secondary server while scaling is active.
Scaling Down
After traffic decreases, requests are routed back to the primary server. The secondary server is then safely shut down after completing any remaining background jobs.
Automatic Scaling
You can configure automatic scaling using CPU and memory utilization thresholds.
- Configure CPU usage limits.
- Configure Memory usage limits.
- Scaling is triggered when either configured threshold is reached.
Scheduled Scaling
If your traffic follows predictable patterns, you can schedule scale-up and scale-down operations in advance.
Scheduled scaling cannot be used while Automatic Scaling is enabled on the server.
Zero Downtime Scaling
Scaling operations are designed to avoid service interruptions. The primary server continues serving requests while the secondary server is prepared in the background. Once ready, traffic is automatically routed to both servers.
Scaling Rules
- Manual and automatic scaling operations must be at least 5 minutes apart.
- Scheduled scaling events must be at least 1 hour apart.
These safeguards help prevent overlapping scaling operations and maintain system stability.
Operations That May Take Time
- Initial secondary server setup may take several minutes depending on the number and size of benches.
- During setup, the server status changes to Installing, while your sites continue running without downtime.
- The first automatic scale-up usually takes longer than subsequent scaling operations.
Notifications
Whenever an automatic scale-up occurs, Frappe Cloud sends an email notification to inform you that additional compute capacity has been activated.
Notifications for automatic scale-down events will be supported in a future release.
Pricing
The secondary server is billed only while it is actively running.
- Receive a 10% discount on the secondary server’s base plan price.
- Billing is calculated hourly based on active usage.
- No charges apply while the secondary server is inactive.
Billing Formula:
(Hours Active) × (Primary Application Server Price − 10% Discount)
Secondary server usage is displayed on your invoices and billed on an hourly basis.
Disable Horizontal Scaling
If you no longer require horizontal scaling, you can remove the secondary server from the Server Actions menu.
During the removal process, the primary server temporarily enters the Installing state while the secondary server is deleted. Your sites remain available throughout the operation without downtime.
If an Auto Scale operation shows a Failure status, contact Frappe Support immediately. Avoid making manual changes, as they may make troubleshooting more difficult.