c# - Post call limit of HttpGetRequestStream -
i trying figure out whether there limit on call "getrequeststream".
to test this, created load test 10 agents , 1 controller trying post call (object size 10kb) , user count of 10. (code below). didnt make call "getresponse()" see if can make large number of calls getrequeststream.
but happened agents load test didnt cross 85 ~ 90 requests per second , contention point line in code "using (stream requeststream = request.getrequeststream())".
i reduced agents down 2 same result. end point server single server box. when used vip ( backed 3 servers @ backend), got 3 times output i.e able go 270 rps. when increased agents again 15 against vip, avg still remained same. concluded there shared resources in use during call getrequeststream
based on earlier post httpwebrequest.getrequeststream : does?
it mentions call getrequeststream blocks resource @ server end , irrespective of number of post calls generated, can serve many requests. used believe getrequeststream doesnt make call gets stream , writes object stream call happens when call getresponse()
httpwebrequest request = (httpwebrequest)httpwebrequest.create("http://some.existing.url"); request.method = "post"; request.contenttype = "text/xml"; byte[] documentbytes = getdocumentbytes (); using (stream requeststream = request.getrequeststream()) { requeststream.write(documentbytes, 0, documentbytes.length); requeststream.flush(); requeststream.close(); } would appreciate if can point me resources can dig more detail or if can explain behavior.
per http 1.1 rfc, httpwebrequest has default connection limit of 2 client host – might cause drop in latency beyond 2 concurrent users. can changed through app.config of client process, see here , here.
Comments
Post a Comment