PlanetJava
Custom Search

java-grinder-user
[Top] [All Lists]

Re: grinder HTTPClient closing connection

Subject: Re: grinder HTTPClient closing connection
Date: Fri, 12 Dec 2008 13:57:34 +0000
The Keep-Alive header is for HTTP 1.0, it is sent because HTTPClient
doesn't know whether the server only supports HTTP 1.0 when it sends the
request.
The Grinder closes all connections for a worker thread at the end of the
__call__ method. If you want multiple requests per connection, wrap them
in a for loop.
- Phil
Manu Shukla wrote:
> I have a simple jython script in Grinder (3.1) that sends http(1.1)
> posts to tomcat (5.5) from console with agent configured for 1 process
> and 100 threads. The outgoing request has keep-alive in request header
> but the response from tomcat does not have keep-alive set in header.
> After receiving response HTTPClient plugin closes the connection. As
> a result tomcat ends up after > 32K connections refusing new
> connections as no more ports are available. Isn't HTTPClient supposed
> to keep persistent connections by default? I  have attached the
> request/response and jython script.
>
> Thanks
>
>  POST /solr/update HTTP/1.1
> Host: xxx:8010
> Connection: Keep-Alive, TE
> TE: trailers
> User-Agent: RPT-HTTPClient/0.3-3E
> Content-type: application/octet-stream
> Content-length: 140
>  
> <add><doc><field name="id">0</field><field
> name="text">hello</field></doc></add>
>  
> HTTP/1.1 200 OK
> Server: Apache-Coyote/1.1
> Last-Modified: Thu, 11 Dec 2008 17:05:35 GMT
> ETag: "M2FkZWY3NjQ3ODgwMDAwMFNvbHI="
> Content-Type: text/xml;charset=UTF-8
> Content-Length: 249
> Date: Thu, 11 Dec 2008 17:15:40 GMT
>  
>  
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">0</int><int
> name="QTime">0</int></lst><str name="WARNING">This response format is
> experimental.  It is likely to change in the future.</str>
> </response>
>
>
> test.py
>
> class TestRunner:
>     def __call__(self):
>  
>         request = chatDetailsTest.wrap(
>             HTTPRequest(url="xxx:8010/"))
>   
>                 parameters = ( NVPair("Content-Type","text/xml"),)
>         # This is the Jython way of creating an NVPair[] Java array
>         # with one element.
>         headers = zeros(1, NVPair)
>
>         
>         data='<add><doc><field name="id">0</field><field
> name="text">hello</field></doc></add>';
>         
>         result = request.POST("/solr/update",data,headers)
>
>        grinder.logger.output(str(result))
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
msgmiddle
<Prev in Thread] Current Thread [Next in Thread>
Current Sitemap | © 2012 planetjava | Contact | Privacy Policy