Blog | Tutorials

How To Prevent Your Server Crashing

21/12/2015

Creating an online presence takes time and effort, and you don’t want all that hard work to go to waste because of a server crash.

For online business, their website and online presence in general can be their most valuable asset.

But suffering from downtime due to a server crashing can be catastrophic for your eCommerce business.

Prevent Your Server Crashing

There are a number of techniques you can employ in order to ensure your downtime is kept to a minimum.

These are simple tools and methods you can implement immediately, from monitoring your server load to ensuring the optimum server room temperature is maintained.

Choosing The Right Server

Before you even get started, you should consider the type and specification of web server you’ll need.

If you’re hosting your website yourself, you might want to read our blog post about how to host your eCommerce website. This option gives you control but comes with its own obstacles to overcome.

  • Shared Hosting – This option saves you money but comes with a risk. You could end up suffering downtime if one of the other users overloads the server
  • VPS Hosting – With this option you still share a server but have your own section of it. You are still at risk if someone crashes the server but your data is better protected
  • Dedicated Hosting – You get a whole server to yourself so it is up to you to maintain it from a client side. However, chances are your server will be located elsewhere from your business and it still at risk from external issues such as heat spikes, fire or flood
  • Cloud Hosting – Alternatively, you may wish to use Amazon Web Services, which is a Cloud solution. This means there is no physical server, so it can’t get damaged or overheat. However, it is still at risk from virtual issues such as a server overload or hacking
  • Own Hosting – If you have the space for it, with the proper climate controls available, you can buy your own server and keep it at your premises. This means you can deal with internal and external issues as soon as they arise. For large enterprise companies, you’ll likely want to look at having two or more separate servers. One functioning as a web server, which hosts the website files, with another server used solely for databases

Firewalls

You should already have these in place if you operate an eCommerce website but often companies set up their firewalls in the early stages and then leave them to run.

There are many different firewall programs available that help you identify and tackle threats to your server, but a lot of the work is going to have to come from you.

Use your firewall software to;

  1. identify and block harmful requests from spam IPs
  2. bottleneck high volumes of spam requests to prevent server overload
  3. prevent harmful viruses from travelling between servers in a network

firewall-software

Temperature Control

It might seem strange to focus on such a basic thing considering the futuristic technology we have at our disposal these days but temperature is vital to ensure your server stays operational.

In 2013, Hotmail lost its server for 16 hours because of a heat spike in its server room. The technology needed to keep the machines cool failed and the servers had to shut down to avoid being damaged.

It is imperative that you keep your server room between 20 and 22 degrees Celsius (around 68-71 Fahrenheit). If it rises above 27 degrees, your servers are going to suffer.

CRON Jobs

A CRON job is a program that allows users to schedule commands or scripts at a specified time and date.

These scheduled jobs are often set for systems such as Magento and WordPress and mean that developers can save time by automating a lot of their updates.

However, when combined with resource-intensive backup processes, these CRON jobs can build up and cause server load to rise. If this rise goes unchecked, a high number of scheduled CRON jobs can lead to a server crash.

A simple solution to this problem is to rearrange the number of CRON jobs occurring at the same time. Spread them out across a longer time frame and so you’ll have less running at once.

You can also schedule them to run during quiet times for your eCommerce website, such as overnight when user traffic is lower.

CRON-jobs-schedule

Monitoring Software

Depending on your situation, you should be making use of server monitoring software to spot issues before they become a major problem causing downtime.

Commonly used tools include NewRelic, Boundary and NodeQuery, all of which will continuously monitor your server load, even when you are away from the office.

These tools will keep an eye on your server and alert you if it reaches a pre-determined load limit. This gives you time to find the issue, address it and solve it before your server crashes.

Always Have a Backup

Though this doesn’t really prevent your server crashing, having a backup is like having home insurance – you need it but hope you never have to use it.

If you use WHM (Web Host Manager), you can setup a daily backup to AWS S3, which will regularly backup all of your important data to a Cloud solution.

There are other cloud backup solutions available, such as CodeGuard, although these may be expensive depending on the type of package you choose.

Conclusion

There are a number of ways you can reduce the risk of a server crash, most of which can be implemented immediately and will start working straight away.

Preventing your server from crashing is a job you can’t put off until later. You never know when an issue may arise out of the blue and cause your server to shut down.

The business you lose during this time and the damage to your reputation is preventable, so don’t put it off any longer – protect your server.