Re:High Performance TCP Proxy Server
by acdha on Saturday April 22, 2017 @12:25PM
(#14173236)
Can you expand on your reasons for making that claim - perhaps with some benchmarks?
[ Parent
| on HN ]
Re:High Performance TCP Proxy Server
by shouldbworking on Saturday April 22, 2017 @12:32PM
(#14173269)
Check out the techempower framework benchmarks. Netty can do over a million http responses per second on a reasonable machine.
On Linux it uses an epoll native driver and is asynchronous. The framework makes it possible to write proxies in a few lines.
If you want to beat netty by a significant margin you'll probably need to use kernel bypass
C++ 17 Networking TS is based on ASIO. It will be very interesting if netty performs better than ASIO based code for the same task.
Re:High Performance TCP Proxy Server
by shouldbworking on Saturday April 22, 2017 @01:09PM
(#14173485)
They both use epoll underneath. Netty will likely perform better because it has a robust thread pool implementation.
Would suggest to look at how thread pooling works in ASIO before making conclusions.
Re:High Performance TCP Proxy Server
by matthewaveryusa on Saturday April 22, 2017 @12:57PM
(#14173410)
ASIO does all that. And it compiles to machine code. What you're basically trying to argue is a well-written C++ application will be slower than a well-written java application. That's not going to happen -- at best they will be the same performance.
Netty certainly has a more impressive list of projects using it in real-world high-volume scenarios. That's probably what wins in this case...enough high volume end users such that you've gotten enough edge cases to tweak the software and iron out bugs.
If I had to pick something in the C/C++ space to implement a custom proxy, I would probably stick to something where I could find a similar list of established high volume real world users. Facebook's Proxygen, or some customized HAProxy maybe.
Re:High Performance TCP Proxy Server
by shouldbworking on Saturday April 22, 2017 @01:08PM
(#14173476)
I was trying to say in a nice way that it's unlikely you've created something as fast as netty because a lot of people spent a lot of time optimizing it.
Netty is also a lot easier to extend and more portable