Nginx is one of the most efficient and reliable web servers available in 2017.
March 28, 2017

Nginx is one of the most efficient and reliable web servers available in 2017.

Anand Chhatpar | TrustRadius Reviewer
Score 9 out of 10
Vetted Review
Verified User

Overall Satisfaction with Nginx

Nginx is used as the main web server and load balancer in front of our Rails apps. We use Nginx + Passenger together as part of our stack for production deployments of our Rails apps.

We currently have 5 different deployments of Nginx, and everyone in the company that deploys production apps uses them.

The main business problem addressed by Nginx was definitely speed and load balancing. Before using Nginx + Passenger, we had Apache servers in front of Mongrel for our rails apps, and they not only were slow and memory intensive, the only load balancing strategy available with that setup was round-robin allocation of incoming web requests to different app servers. With Nginx, it acts as a load balancing proxy as well and keeps track of which app servers are free to receive new requests. This resolves bottlenecks in our server's performance.
  • Nginx works really well for serving static files. You can let requests for static files and assets pass directly through to the file system and Nginx will serve them really fast, without touching your web app processes.
  • Nginx does a great job with load balancing. You can set up different load balancing strategies, but the default load balancer it comes with out of the box works very well already -- better than any round-robin approach because it checks for availability of the resource before handing off the incoming request.
  • Nginx is more memory efficient and generally faster than Apache. It has a small footprint, which can be very helpful, especially if you're running on a VPS.
  • Nginx has not crashed on me even once. The robustness of Nginx overall is very impressive.
  • You can apply configuration changes to Nginx without needing to restart the server. You can also do reloads of the config without dropping any web requests because Nginx provides a global queue where requests can be held while it reloads the config.
  • There's no configuration wizard. I had to read their docs every time I make a change to the Nginx config files.
  • Deploying rails apps with Nginx + Passenger requires a recompilation of Nginx. It would have been better if Nginx supported a plugin system that would allow you to plug in some rails app servers into it.
  • There's no easy way to tell which incoming request was sent to which back-end app server. You have to do advanced tricks to keep track of those things, in case you need to see what's happening behind the scenes for debugging.
  • Improved the reliability of our site. Before using Nginx, with Apache as our app server, there were times when we had to manually go in and restart Apache to bring the site back online. We've never had to do that with Nginx.
  • Made our web server more memory efficient -- Nginx has a very small memory footprint, on the order of under 100 MB. This makes it suitable even for cheap VPS machines.
  • The Nginx community provides online examples of configurations, so it saves us time in writing the config files from scratch.
Before using Nginx with Passenger, we had Apache servers in front of Mongrel for our rails apps. They would leak memory, and need periodic restarts to stay online. The memory management on Apache and Mongrel was very inefficient. Nginx does great with both speed and memory efficiency, while maintaining uptime and even distribution of load across back-end app servers. This made it an easy choice for us.
Nginx is great as a web server. For serving Rails apps, Nginx + Puma seems to have become the norm, but has memory leakage issues because of Puma. Nginx itself is quite robust and we find Nginx + Passenger as the right production-ready setup for deploying Ruby on Rails apps. I cannot think of any specific scenarios where I would recommend against using Nginx.