Automatic Failover: Server Crash Switchover Setup

When your production server goes down, every second of downtime costs revenue. Without automatic failover, recovery can take hours while someone manually intervenes. We configure automatic failover so that traffic switches to a standby server within 30–120 seconds, slashing RTO from hours to seconds

Development and maintenance of all types of websites:

Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:

Frequently Asked Questions

Latest works

  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1281
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1237
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    977
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    1026
  • image_website-sbh_0.webp
    Website development for SBH Partners
    1103
  • image_website-_0.webp
    Website development for Red Pear
    550

When your production server goes down, every second of downtime costs revenue. Without automatic failover, recovery can take hours while someone manually intervenes. We configure automatic failover so that traffic switches to a standby server within 30–120 seconds, slashing RTO from hours to seconds. For a typical e-commerce site earning $10,000/hour, reducing RTO from 15 minutes to 45 seconds saves over $2,200 per outage. With over 7 years of experience in fault-tolerant architectures and 40+ failover projects, our engineers hold AWS and Linux certifications and deliver stable, battle-tested solutions.

How automatic failover works

Failover can be implemented at different stack levels: DNS, load balancer, virtual IP (VRRP), and database. Each has trade-offs in switchover speed, complexity, and cost.

DNS-level is the simplest but slowest. A health check polls the primary every 10–30 seconds. On failure, the DNS record is updated to point to the standby server. The total delay comprises the record TTL plus detection time: 60–300 seconds. Suitable for most web applications where a 5-minute pause is acceptable.

Load Balancer (e.g., AWS ALB/NLB, nginx upstream) switches in 5–30 seconds but requires both servers in the same cloud or region. Health checks operate at the balancer level.

VRRP / Keepalived uses a virtual IP that moves between servers when the master fails, achieving 2–5 second switchover. Classic for on-premise and dedicated setups. Keepalived is 5 times faster than DNS failover.

Database failover is a separate challenge. The application must know the new primary DB. Solutions like Patroni (PostgreSQL), MHA (MySQL), or AWS RDS Multi-AZ handle this automatically.

DNS vs Load Balancer: Comparison

Parameter DNS failover Load Balancer
Switchover time 60–300 s 5–30 s
Setup complexity Low Medium
Cloud dependency No Yes (often)
Best for Most web applications High-traffic systems

DNS failover is 10× slower than a load balancer but simpler and provider-agnostic.

Example: AWS Route 53 configuration

Route 53 Failover Policy: Primary record → 1.2.3.4 (main server) Health check: HTTP GET /health, port 443 Failure threshold: 3 consecutive failures Request interval: 10 seconds Secondary record → 5.6.7.8 (standby server) Evaluate target health: Yes 

The /health endpoint must verify real readiness: database accessible, cache working, disk space sufficient. It should return 200 only when fully operational. Our engineers customize this check to your stack.

Keepalived for bare metal and VPS

# /etc/keepalived/keepalived.conf on PRIMARY vrrp_script check_app { script "/usr/local/bin/check_app.sh" interval 5 weight -20 fall 2 rise 2 } vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 51 priority 100 advert_int 1 virtual_ipaddress { 192.168.1.100/24 } track_script { check_app } } 

The check_app.sh script verifies application liveness locally. After two consecutive failures, the BACKUP server (priority 90) takes over the virtual IP.

Why failover testing is critical

Regular drills are mandatory. An untested failover will likely fail when you need it. Our standard verification protocol:

  1. Confirm monitoring records the initial state.
  2. Simulate failure: systemctl stop nginx or iptables -I INPUT -p tcp --dport 80 -j DROP on primary.
  3. Record time until switchover.
  4. Verify service via the standby server.
  5. Restore primary, test automatic fallback.

Target metrics: detection time < 30 s, switch time < 60 s, total RTO < 120 s. Automatic failover is 20 times faster than manual recovery.

Example full test scenario

For a comprehensive test, simulate simultaneous network, database, and application failures. Measure the time until full service recovery.

Case study: High-traffic e-commerce failover

A client with a peak-time load of 5000 requests per second experienced 15-minute downtimes when their single server failed. We implemented a two-tier failover: Keepalived for virtual IP switching and Patroni for PostgreSQL database failover. The result: automatic recovery in under 45 seconds, even during Black Friday traffic spikes. Revenue loss from unplanned downtime dropped by over 85%, saving approximately $2,000 per outage.

What's included in our turnkey failover setup

  • Analysis of current architecture and availability requirements
  • Designing the failover scheme (DNS, load balancer, VRRP, DB)
  • Configuring health checks and monitoring
  • Implementing data synchronization (database replication, file sync, sessions)
  • Developing automatic switchover scripts
  • Testing failure and recovery scenarios
  • Documentation and team training
  • Optional post-deployment support

Our team: 7+ years of experience, 40+ implemented failover projects, and certified engineers (AWS, Linux).

Setup duration estimates

Failover type Estimated time
DNS (Route 53 / Cloudflare) 1–2 days
Keepalived + synchronization 3–5 days
Full scheme with DB failover (Patroni) 5–10 days
Testing and documentation 1–2 days

Exact timeline depends on infrastructure complexity. Contact us for a free assessment.

The split-brain problem and its solution

Split-brain occurs when both servers claim to be primary. In Keepalived, it is solved by fencing (STONITH) — the weaker node is forcibly shut down upon conflict. In PostgreSQL/Patroni, an external DCS (etcd, Consul, ZooKeeper) acts as an arbiter. We guarantee your scheme prevents this scenario through split-brain prevention mechanisms.

Monitoring failover events

Every switchover is an incident that requires investigation. Alertmanager or PagerDuty capture the event. A ticket is automatically created in Jira/Linear. After remediation, a root cause analysis determines why the primary failed.

Contact us to discuss your project. Order failover configuration and ensure your service stays available.