We help IT Professionals succeed at work.

ASMX Web Service Response exactly after 15 seconds delay in IIS 7

Rose Babu
Rose Babu used Ask the Experts™
on
Hi Experts,

i have one strange response problem with my VB.NET web service (ASMX) hosted in Win 2008 server (IIS 7).

The win server is connected via VPN and firewall to get access. I've hosted our web service in IIS and while trying to access it from the other end, we have constantly getting 15 seconds delay on the response.

The request (ssl secured request is made) is reaching the IIS and then the 15 seconds delay is occurring then the request reaching the service and immediately (~40milliseconds) the response is returned. so totally the response is going after ~15.40 seconds.

Why is the 15 seconds delay is occurring before each response? what do i need to check for this?

since our test server returns the response immediately (~40ms) which is public and not having external firewall.

while checking the packets traffic using WireShark application, we found the request is reaching the IIS and then there is 15 seconds delay before the response.

Can anyone provide a solution or suggestions that would be appreciate a lot.

Rose.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Aaron JabamaniTechnical Architect

Commented:
what exactly you are doing in the web service ?
Rose BabuSenior Team Manager

Author

Commented:
hi apeter,

actually the web service is used to send the balance detail of a registered user. right now the service gets the request and send a sample response.

in the test server (win2008 server) the response is coming very quickly. but in production server is only the problem occurs.

same code is used in both server. only thing i doubt is on vpn, firewall and probably ssl.
Aaron JabamaniTechnical Architect

Commented:
did u find which place is taking more time? request reaching server, or server processing or after processing response coming back to client ?
Rose BabuSenior Team Manager

Author

Commented:
from the captured packet, we have found the request is reaching the IIS then there is 15 seconds delay and then the request is reaching the service. Then the service is returning the response in ~40 ms.

client rejects the response if it comes after 4 seconds. :-( but our response is going within ~40 ms except the 15seconds delay before the response. (i try to provide some more additional info)

to test it, there is nothing coded inside the service method, only sample response data is returned immediately.

i guess the worker process (HTTP.SYS) module may be causing the delay. or might be any other IIS 7 modules checking or or doing validations on the request.
Aaron JabamaniTechnical Architect

Commented:
can you do a logging like...before the method executes and the end of the methods executes. So that we can freeze whether the iis is taking time or really the methods is taking time.
Rose BabuSenior Team Manager

Author

Commented:
yes, we have tried with failed request log in iis7 and got the error log. and also we have captured packet details. I'm looking on the logs. wil post the details...
Senior Team Manager
Commented:

we have overcome this issue by hosting our web service in Windows 2003 (IIS 6) server.
Now the service is returning the response very quickly (lesser a second).

So the problem is totally bcoz of the IIS 7 in windows 2008 server.

we have implemented the same code in windows 2003 server (IIS 6) under same VPN and firewall.
Now our service is working very fast. The response is coming very quickly (withing a second)

since we involved Microsoft's IIS team to look on this. They didnt come up a solution, instead they asked all the logs regarding this. looking on their suggestions.


and finally with the Failed Request log, i have found the time delay . where it delays is in "ManagedPipelineHandler" module in IIS 7.

By digging Failed request Log xml, i found the time delays as below.

ManagedPipelineHandler (MAP_REQUEST_HANDLER)  ran for 9267 ms
ManagedPipelineHandler (EXECUTE_REQUEST_HANDLER) ran for 4586 ms

So the ManagedPipelineHandler module in the IIS 7 is making the time delay, as per the log.

below is the log details for the delay with timings.

95. ? NOTIFY_MODULE_START ModuleName="ManagedPipelineHandler", Notification="MAP_REQUEST_HANDLER", fIsPostNotification="false", fIsCompletion="false" 12:06:27.410 
96. ? AspNetMapHandlerEnter  12:06:27.410 
97. i GENERAL_READ_ENTITY_START  12:06:32.168 

100. ? AspNetMapHandlerLeave  12:06:36.677 

116. ? NOTIFY_MODULE_START ModuleName="ManagedPipelineHandler", Notification="EXECUTE_REQUEST_HANDLER", fIsPostNotification="false", fIsCompletion="false" 12:06:36.677 
117. i AspNetHttpHandlerEnter  12:06:36.677 
118. i AspNetHttpHandlerLeave  12:06:41.263 
119. ? NOTIFY_MODULE_END ModuleName="ManagedPipelineHandler", Notification="EXECUTE_REQUEST_HANDLER", fIsPostNotificationEvent="false", NotificationStatus="NOTIFICATION_CONTINUE" 12:06:41.263 

Open in new window

To fix it in IIS 7, we are going to do the following in IIS 7.

1. Application Pool Set “Mangaed Pipeline Mode” to Classic Mode
2. Application Pool : Advanced Settings
                Idle TimeOut : 0
3. Disable Application Pool Recycling

and waiting for IIS team's suggestions. once if we have fixed this issue in IIS 7, we will post the details.

thanks to apeter for looking on this issue.
Rose BabuSenior Team Manager

Author

Commented:
we have hosted our web service in IIS 6 (win 2003 server). Now there is NO time delay on response and response coming within a second.

still we are looking on this issue to fix in IIS 7 (windows 2008 server). post the details if anyone has fixed issue like this.
Rose BabuSenior Team Manager

Author

Commented:
finally we have hosted our web service in IIS 7 (win 2008 server). now our web service is returning response very quickly as expected.

we have changed the Application Pool's managed pipeline mode to "Classic" in IIS 7. and now It works fine.

we fixed this issue on two weeks before. i delayed to post it here. anyhow this may help someone.
Aaron JabamaniTechnical Architect

Commented:
Thanks for sharing.