HTTP Keep Alive Handling on the server side

975 views
Skip to first unread message

Ryan Moore

unread,
Aug 13, 2013, 6:06:06 PM8/13/13
to ve...@googlegroups.com
How exactly does HTTP keep alive function on the server side in vertx?  Is the expected behavior that if the client is using HTTP keep alive then a new HttpServerRequest will be created on the server (assuming close() was not called on the request)?  Or is there something that I'm missing?  The reason I'm asking is that I've been playing around with a couple verticles that send data back and forth via HTTP connections, and I run out of file descriptors, so I'm trying to understand how I should manage the connections.  Adding more keep alive connections to the pool with setMaxPoolSize() seems to help but I've hit a wall with it.

--
Ryan Moore

Tim Fox

unread,
Aug 14, 2013, 4:55:49 AM8/14/13
to ve...@googlegroups.com
HTTP Keep Alive just means that the client pools connections, i.e. it
doesn't close them automatically after a request..response has been
completed.

Perhaps I don't understand the question..?

Ryan Moore

unread,
Aug 14, 2013, 3:52:46 PM8/14/13
to ve...@googlegroups.com
Right, but how is (or how should) the http server in vertx going to behave when the client re-uses a connection?

Tim Fox

unread,
Aug 14, 2013, 3:56:04 PM8/14/13
to ve...@googlegroups.com

The server doesn't care if the connection has been used for other requests before or not.

> --
> 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/groups/opt_out.

Ryan Moore

unread,
Aug 14, 2013, 4:00:40 PM8/14/13
to ve...@googlegroups.com
So it will issue a new call to the request handler?

Tim Fox

unread,
Aug 14, 2013, 4:28:54 PM8/14/13
to ve...@googlegroups.com

The request handler is called whenever a request arrives on the server.

Ryan Moore

unread,
Aug 14, 2013, 11:33:00 PM8/14/13
to ve...@googlegroups.com
I've been doing some more code reading and I'm beginning to understand how the requests come in, and in the process I think I found my problem.  One each new request to one of my verticles I was creating a new HttpClient instead of reusing the same one, so I had a bunch of connection pools that were all getting created without a call to close on the HttpClient.

I'm going to play around with it more to see if that is what is definitely causing my problem.  It seems like the culprit though.

Thanks for the help!
Reply all
Reply to author
Forward
0 new messages