HTTP client for throughput - Netty vs Apache HttpAsyncClient
Asked Answered
M

1

6

I'm interested in executing about 50 HTTP requests/second from a single machine. I don't care so much about latency but I do care about throughput.

I'm trying to decide whether to use Apache HttpAsyncClient or use Netty. Could someone shed some light about the advantages of each regarding my problem?

I've found this comparison but I was hoping for a little bit more detailed explanation on which one is better and for what use case. Also, does the comparison means that using the synchronous apache HTTP client with 200 threads be better than the other options? Isn't 200 threads a bit too much (assuming I'm using a normal computer with 4 cores, 2 threads per core and 12GB of RAM)?

Thanks in advance

Mohenjodaro answered 17/2, 2016 at 15:52 Comment(4)
The main problem with these benchmarks is that in real life you have more threads and much more noise, so you can't really expect to get similar results in production unless you go for the async IO option. You're looking into getting more throughput, and as expected Netty wins big time in their benchmark. We're using Netty very successfully for a wide array of applications, and it never fails us. You can use ning async-http-client, and then you don't have to implement it all by your self - github.com/AsyncHttpClient/async-http-client. Hope this helpsComply
@EranHarel it helps a lot. Did you ever compare Apache async client against the ning one?Mohenjodaro
We get better throughput using ning in our use-cases. You should test this yourself of course. Don't trust a random post on the internet, or the word of a random dude on StackOverflow ;)Comply
Thanks for the tip. Write it as an answer and I'll accept it :)Mohenjodaro
C
13

The main problem with these benchmarks is that in real life you have more threads and much more noise, so you can't really expect to get similar results in production unless you go for the async IO option.

You're looking into getting more throughput, and as expected Netty based clients wins big time in their benchmark. So it's probably your best bet.

We're using Netty very successfully for a wide array of applications, and it never fails us. You can use ning async-http-client, and then you don't have to implement a client all by your self.

Do note however, as I stated in the comments, I base my answer on my personal experience, and on our production metrics. Never believe a random benchmark post you see posted on the internet, nor a StackOverflow answer. Test it your self ;)

Comply answered 22/2, 2016 at 19:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.