HttpWebRequest taking lot longer compared to ServerXMLHTTP
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

anshu
Hi,

I've to migrate an existing code in asp to asp.Net. The asp code uses
ServerXMLHTTP to call some services. Same thing will be done using
HttpWebRequest in the asp.Net code. The problem is keeping everything
same HttpWebRequest takes around 100-200ms more than ServerXMLHTTP to
call the service.

The bottleneck was HttpWebRequest.GetResponse, which was taking most
of time. Once I set the ContentLength for HttpWebRequest object it
seems bottleneck shifts to HttpRequest.GetRequestStream(). I think its
taking time writing the content to the stream or initializing the
stream.

What ever it is doing 100-200ms extra time per call is too much. Does
some one know a better way to do this?

Regards
Sudhanshu
Reply to this message...
 
    
Feroze [msft] (VIP)
Some of the reasons for this delay could be:

1) the backend server is challenging the request for credentials. If the
server is requesting Windows Integrated Authentication, the request will be
authenticated each time, and that will contribute to the delay. This can be
mitigated by using UnsafeAuthenticatedConnectionSharing or using a different
auth scheme on the backend server.

2) The nagle algorithm on Tcp is causing the delay. This can be switched off
through a config setting.
--
feroze

-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.

See http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------

"anshu" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 
System.Net.HttpWebRequest
System.Web.HttpRequest




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com