Hello Nicolas,

at this time, when a request is sent, the client connector looks for a 
connection opened for the same address and port. However if the 
connection is busy to write a previous request, then another connection 
is opened (according to the "maxConnections" parameter). If no 
connection is available, then the request is not handled.

If you send thousand of requests in parallel, there are chances that the 
number of opened connections grows. That sounds quite odd since a 
connection seems able to add a new message to its list only if it not 
busy... I've update the issue 304 
(http://restlet.tigris.org/issues/show_bug.cgi?id=304) which must be 
fixed for next release (2.0 RC1) in mid-march.

Best regards
Thierry Boileau

> I've been trying to get persistent connections to work for my application 
> running on Restlet 2.0m7, using the Simple server connector and the default 
> client one.
>
> To make sure that it behaved properly, I wrote a quick test that sends 
> thousands of queries to the server and counted the number of open sockets 
> using lsof - if my understanding of persistent connections is correct, I 
> should see at most 4 or 5 open sockets, but I'm observing hundreds of them. 
> Mind you, I'm seeing less open sockets than I'm sending queries, but I can't 
> decide whether it's because connections are re-used or because they get 
> closed eventually.
>
> I've tried setting the http.maxConnections to 1 on the client side, but that 
> doesn't change anything.
>
> I'd file that as a bug, but I'm not convinced I understand persistent 
> connections well enough - maybe this is the normal behavior and I'm missing 
> something. Can anyone enlighten me on the matter ?
>
> Nicolas
>
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2447687
>
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2448017

Reply via email to