Question: What are the Pros and Cons of Nginx and Netty for using building a Proxy Server.
Elaborating the problem:
We are trying to implement a proxy server (forward or reverse proxy) which is placed in front of a service and takes care of good practices that can be applied on our services.
So we are evaluating different solutions that are available in the market mainly Nginx and Netty. So when we initially did our research on Nginx, we came across a good amount of positive blogs which suggested that Nginx is very fast, easily configurable by writing the custom modules to plugin to Nginx.
But when we did a POC on Netty, we got much better performance numbers while using Netty 4. So I would like to know if some one have performed some comparison between Nginx and Netty and also what are the reasons for not using Netty as a reverse/forward proxy solution. We are worried on GC problems associated with Java Server solutions hence we want to know the Pros and Cons of Nginx and Netty before going ahead with a solution.
Thanks, Vinay.
I'm not aware of detailed comparisons because you're not comparing apples to apples here. Netty is a very low level java framework, while nginx is a mostly complete proxy. I am not sure what you wrote for your example on netty. Without doing any tests my self I imagine it would be pretty hard to make a functional proxy on netty which is faster than nginx.
I think if you want a simple proxy server you should go with nginx since it will most likely have all the functionality you need for a basic proxy. nginx is fast and mature so it should do very well for the basic use case.
If you are looking at a more complex proxy, with special plugins. Maybe things like ratelimiting/custom authentication, etc. then it might be worth considering using netty. These things can be build on nginx but requires using Lua scripts. You may prefer to use java as a developer.
If you do end up going with netty, just remember you may have to reimplement may complex features such as backend load balancing.
I use a load balancer written on netty, so I don't want to discourage you. I just want to point out that one is a prewritten optimized reverse proxy while the other is one you'd have to write yourself from scratch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With