Minimize downtime for an application
Go live on Azion without a gap in service, and keep the application answering when an origin fails, with Load Balancer, stale cache, and a custom page.
Downtime comes from two places: the switch that brings traffic to Azion, and an origin that stops answering later. You avoid the first by finishing the setup before the DNS change. You limit the second with a backup origin, an expired copy from cache, and your own error page.
Prerequisites
- A workload, an application, and a connector on Azion. To set them up, refer to Migrate an application to Azion.
- Access to the DNS records of the domain at your DNS provider.
Go live without a gap
Users notice only the DNS change, so everything else comes first:
In the workload’s Digital Certificate field, select a certificate that covers the custom domain. Without it, HTTPS fails as soon as the domain resolves to Azion.
In Subdomain and Domain, enter the host name users type.
Load the application from your own computer before any user does. For the steps, refer to Test an application through the hosts file.
At your DNS provider, point the CNAME record at the workload domain. For the steps, refer to Point a domain to a workload.
Users reach the application on Azion as their resolvers pick up the change. Until then, the previous provider keeps answering them, so keep it running through the propagation.
Keep answering when an origin fails
Load Balancer, a feature of the connector, spreads requests across several origin addresses. It skips an address that returns a 4xx or 5xx error or exceeds the connector’s timeouts. To add a backup origin:
Access Azion Console > Connectors > your connector.
In Addresses, add the address of the backup origin.
Set its Server Role to Backup, so it receives requests only when every Primary address fails.
In Balancing Method, select Round-Robin or Least Connections. Server Role applies to these two methods.
When the primary origin fails, requests go to the backup origin instead of returning an error. A connector holds up to 10 addresses with Load Balancer active.
Answer from cache while the origin recovers
A cache setting with Stale cache on lets Azion serve an expired copy when the origin fails, instead of an error. The Console turns it on when you create a setting; the API and the CLI leave it off. To check it:
Access Azion Console > Applications > your application > Cache Settings tab.
While the origin is down, requests for content Azion has already cached are answered with the last copy.
Show your own page instead of an error
When the origin fails for content that is not in cache, a custom page set replaces the 5xx response with a page you host. Serve that page from a connector that stays up when the origin fails, such as an Object Storage bucket. To create the set:
Access Azion Console > Custom Pages.
Select + Custom Page Code and, in Page Code, select 503.
Select the Connector that serves the page and, in Page Path, enter its path. For example: /errors/503.html.
In Response TTL, enter the seconds the page stays in cache.
Access Workloads > your workload. In Deployment Settings, select the custom page set, then select Save.
A 503 from the origin now returns your page. The status code stays 503 unless you set Response Custom Status Code.