<img alt="" src="https://secure.leadforensics.com/150446.png " style="display:none;">
Go to top icon

Apache vs Nginx

Prasannasingh Bayas Oct 18, 2016

apache Nginx Web Server Gateway Interface (WSGI)

apache-vs-ngnix.png
Today, the two most amazing open source servers, Apache HTTP and Nginx are ruling the internet world. Apache being the oldest is being used on large scale by the enterprises. However with the growing online traffic, Apache server deprives in terms of scaling and performance due to load of multiple processes, resulting into additional consumption of computer memory. On the other hand, Nginx being able to manage large amount traffic is the second most used proxy server. Nginx was written particularly to address the performance limitations of the Apache server. Thus, Nginx being an emerging technology is now slowly taking over Apache. 

One of our recent project was running on Apache server as it is very easy to install and flexible. Still, it was facing performance issues and was slowing down due to concurrent requests sent to the server. 

Why we decided to opt of NGINX server?

Our product was a build on Python having lots of static files for website where all static files were stored in Amazon S3 bucket. To access these files, multiple concurrent requests were sent to the server resulting into its slow performance. Therefore, a highly scalable server having a better performance was required to cache those static files and provide access to them within fraction of time. Nginx being fast at serving static files with good scalability, was able to handle multiple HTTP requests concurrently. This was due to its event-driven architecture and as a result, we decided to move from Apache to Nginx. Also, for serving static pages, Nginx server consumed less memory as compared to Apache, as in this case generating new process for every new request was not required. These processes being single-threaded were able to handle multiple connections asynchronously. Other than performance and memory, Nginx provided us with an added advantage of seamless support to Python. Web Server Gateway Interface (WSGI) being a common method of communication between Python and Nginx worked in multi-threaded and multi-process environment providing a good scalability for all kind of deployments. 

Our site was more of static one and hence opting for Nginx was the best decision for us. Furthermore, Nginx is open source, lightweight and provides all the core features of the web-server. But if you are looking for some advanced features like flexibility, documentation and security then Apache Server is for you. Both have their own pros and cons. So, opt for the server which completely suits your project needs. 

e-Zest is a leading digital innovation partner for enterprises and technology companies that utilizes emerging technologies for creating engaging customers experiences. Being a customer-focused and technology-driven company, it always helps clients in crafting holistic business value for their software development efforts. It offers software development and consulting services for cloud computing, enterprise mobility, big data and analytics, user experience and digital commerce.