Scalability Blog

Scaling tips, insights, updates, culture, and more from our Server Experts.

How Does Nginx Speed Up Server Performance?

Nginx, a web server exported from chilly Russia, was officially found to be the 2nd most popular webserver for active websites in June of 2012 by Netcraft. In terms of overall marketshare, the study placed it third, behind Apache and Microsoft IIS. However, considering that the server’s first public release was in 2006, the software’s growth has been nothing short of exponential.

Nginx is now the official web server for over 60 million domains and services some of the internet’s most trafficked sites, such as Hulu, Facebook, Netflix, Instagram, and WordPress. Its rapidly growing popularity and great reception make it a force to be reckoned with for competitors and a great help to developers looking to set up a fast and efficient site.

How exactly does nginx achieve blazing speeds? It sets itself apart from the other top web server powerhouses (such as apache) by being able to handle an enormous amount of concurrent connections. Nginx architecture does not require each connection to spin up a a new process.

Instead of Apache’s threaded method, Nginx speeds up server performance by using an asynchronous event-driven approach. The software responds quickly to server requests and serves static files at the brisk pace: javascript, CSS, various media, and movies charge through the nginx infrastructure at high speeds.

Nginx is also easy to scale. When it works as a reverse proxy, the program can be a powerful load balancer, spreading connections out across as many available servers as needed. This increases the speed of each server and beefs up the security—nginx offers sophisticated Denial of Service Attack protection by dividing the harmful and harmless traffic and dealing with them separately.

All of this highlights one of nginx’s greatest strengths: its flexibility. Depending on the situation, nginx can either act as an independent web server or be configured as a reverse proxy with an application server behind it to process the dynamic code (like php, python, perl, and others).

While the program is nearly unparalleled in the way that it serves static files, making it into a reverse proxy can increase speed even more. Combining nginx with an application server behind it (apache is great choice for the job) allows nginx to continue serving site visitors while the application server works through the meatier back end.

What started eight years ago as a way for the giant Russian site Rambler to process its hundreds of millions daily requests has now become a sleek, efficient, useful program that can speed up the processes of any server. It may only serve around 10% of the internet’s domains now, but nginx moves quickly, and that percentage can only keep zooming up.