We have a Virtual server that has the LAMP stack installed. There are a reporting scripts, uptime pages and PHP application crons running throughout the day on this server. We have had memory issues in the past due to which the server crashed a couple of times. So far we have upgraded the memory, optimized the PHP scripts that have helped in managing the memory issue.

We are looking to ensure that the report and application scripts would run as usual even in the event of a Server crash. I would like to know what sort of failover or replication can we setup so that there is business as usual.

Any suggestion would be greatly appreciated. Thanks!

  • Most Linux distros have some sort of high-availabilty (HA) packages available. One of the most common methods of implementation is a heartbeat service where if a daemon on one server can't reach it's counterpart on the other server, it takes steps to provide the clustered services (starts services, takes over a virtual IP, takes control of shared storage, etc.) Feb 8, 2017 at 12:23
  • The first thing you need is another server. Feb 8, 2017 at 18:06

2 Answers 2


You may want to check into Round Robin DNS. with some caveats

Round Robin DNS is a method of applying multiple IP addresses (DNS PTR record) to one hostname (DNS A record). DNS will rotate over the PTR records whenever an A record is requested. It isn't an HA solution, but if one IP address is down, the user can re-load their web browser and a different PTR will be handed out. One thing that makes it appealing is that it's a 5 minute config in DNS to add a few IP addresses, and then just clone all the VMs you want to be in the pool (NOTE: each VM needs it's own unique IP address of course).

The caveats I've run into before are:

  • If the application issues a re-direct to it's hostname be aware this causes a new IP address to be handed out to the user. Sometimes the "down" IP gets handed out. This can be trouble from the get-go when doing an HTTP > HTTPS redirect.
  • SSL certificates need to be considered.
  • Application session state is undeterminable

Personally, I gave up on RRDS for web applications years ago (works fine for things like LDAP) but there may be new and exciting things that have developed to handle some of the above issues.

Your use case may not require SSL or redirects so maybe it's a fit, maybe not. In my expericence the HA solutions (Open Source) require a lot of complexity, time and effort to setup. Vended solutions are easy, but require deep pockets and (often times) frustrating support experience.

  • This kind of round robin load balancing can bite one in the buttocks, if the server itself stays up but the app pool on it dies. All of a sudden, a percentage of web calls to the load balanced cluster come back as 500's (failures) or 503's (timeouts) because the server receiving the web call is no longer able to service it. To combat this, you need a means to pull systems out of network load balancing clusters when their apps are in a failing or failed state, or are undergoing maintenance. Feb 8, 2017 at 23:42

If your willing to purchase a license, go for double-take by vision solution. It's a continuos HA and disaster recovery, you can have a second vps in real time sync with your primary and in case of fail, you can simply switch IP on the clone to take over requests..



You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .