Netty vs Nginx: Pros and Cons based on Performance, Memory Management, Memory Footprint Netty vs Nginx: Pros and Cons based on Performance, Memory Management, Memory Footprint nginx nginx

Netty vs Nginx: Pros and Cons based on Performance, Memory Management, Memory Footprint


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.


I've not seen or done any side by side comparisons, but as far as Netty goes, with some careful coding and the use of pooled direct memory buffers, you should not see much GC activity.