Vert.x 3 httpclient and keepalive: No buffer space available (maximum connections reached?): connect

203 views
Skip to first unread message

Finn Bock

unread,
Nov 5, 2014, 5:38:55 AM11/5/14
to ve...@googlegroups.com
Hi,

I'm playing with vert.x 3.0 http client and trying to fire a lot http client request to a REST service, but quite quickly I run out of ephemeral  ports.

nov. 05, 2014 11:22:32 AM io.vertx.core.http.impl.HttpClientImpl
SEVERE
: java.net.SocketException: No buffer space available (maximum connections reached?): connect

I've tried to enable keepalive on the http client, but to no avail.

https://gist.github.com/bckfnn/ce2c480c408e405d6d4c

What is the mechanism on vert.x 3.0 to ensure that connections are resused, so my application will not fail under load.

regards,
Finn

Tim Fox

unread,
Nov 5, 2014, 5:44:31 AM11/5/14
to ve...@googlegroups.com
Can you provide a server too, so this can be replicated?
--
You received this message because you are subscribed to the Google Groups "vert.x" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vertx+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Finn Bock

unread,
Nov 5, 2014, 5:57:18 AM11/5/14
to ve...@googlegroups.com
Hi Tim,

I have updated the gist so it includes a (probably incomplete) http server.

https://gist.github.com/bckfnn/ce2c480c408e405d6d4c

regards,
Finn

Tim Fox

unread,
Nov 5, 2014, 6:05:34 AM11/5/14
to ve...@googlegroups.com
Looking at the code I think there is a bug, so if you queue up a lot of requests very quickly like you do, then it will try and connect them all even though (by default) there should never be more than 5 connections.

Finn Bock

unread,
Nov 5, 2014, 6:17:13 AM11/5/14
to ve...@googlegroups.com

On Wednesday, 5 November 2014 12:05:34 UTC+1, Tim Fox wrote:
Looking at the code I think there is a bug, so if you queue up a lot of requests very quickly like you do, then it will try and connect them all even though (by default) there should never be more than 5 connections.

That is certainly a possiblity, but I try to avoid queing too many request by triggering the next request in the end handler of the previous request.

If not that way, what way?

regards,
Finn

Tim Fox

unread,
Nov 5, 2014, 6:20:39 AM11/5/14
to ve...@googlegroups.com
I haven't looked in detail just looking at the code. BTW to reuse ports call setReuseAddress(true) same as in vert.x 2.x but default should be true anyway


If not that way, what way?

regards,
Finn

Reply all
Reply to author
Forward
0 new messages