Home / Development / Switch to nginx Before Traffic Explodes?

Switch to nginx Before Traffic Explodes?

The word about nginx is out. The efficient Russian web server was previously only known to web developers and system administrators, but has now been seeing wider coverage. With good reason. A sizable chunk of the highest traffic sites on the web have switched over to nginx and it’s likely the rest have at least considered it.

So what’s the big deal? For each user that visits your site, Apache fires up a separate process to serve the content they requested. The process ends when the content has been served. For an average website, that works just fine. If you generally only have a handful of concurrent connections (that is, simultaneous visitors), your system may be able to handle the memory being eaten up by that handful of processes.

Problems arise, however, as the number of concurrent connections increase. Eventually resource requirements, memory in particular, start growing astronomically. That’s when system administrators turn to nginx. Unlike Apache, it doesn’t need a separate process for every visitor. That’s because nginx is event-driven and non-blocking. This means when multiple users make requests, each of which is waiting on the database, or a PHP script or something else other than actually sending data to the user, nginx can move on and handle another request while the database or PHP script is doing its work.

So why isn’t the whole web already on nginx? nginx is more bare bones and simple than Apache, and doesn’t offer every single feature that Apache does. A lot of web software is written with Apache and some particular features it provides in mind. Depending on what you are doing, nginx may or may not be ideal for your site. But if you have good reason to expect heavy traffic loads, or are experiencing them already, it’s definitely worth investigating if nginx can work for you.

nginx is available at A2 Hosting. VPS users can auto-install nginx with our exclusive A2 QuickInstaller.

About Dave Matteson

David is a Lead Developer at A2 Hosting. He has been writing code professionally for nearly twenty years, and enjoys writing and reading about programming. David does his coding from his house in the woods with his wife and dogs

Check Also

A hand holding contact icons.

How to Create a Quality Contact Page for Your Website (In 5 Steps)

Websites are not only platforms for you to sell your business. They can also be launchpads …