2

I have created a web service application hosted in Azure. The service process runs at about 10 minutes to complete and returns a single string with 2782 characters. The service timeout has already been set to 1hour but still I'm receiving a timeout error.

But when I send a small data to process, within 5 min the service responses perfectly.

ERROR: "The operation has timed out"

Note: When I tested my application using the published web service in my local IIS, the process runs smoothly. I also tried to test the service via remote connection of the instance of the hosted service in azure, and it also works fine.

Erwin
  • 4,757
  • 3
  • 31
  • 41
krstn.m
  • 21
  • 3

1 Answers1

1

The Azure load balancer kills all idle connections after one minute. This is likely what is causing you this problem. There is no way to configure the load balancer to allow for longer connections. You might need to change the service to use a post then poll method while you wait for the service to complete. For a full explanation and sample code, see this question.

Community
  • 1
  • 1
knightpfhor
  • 9,299
  • 3
  • 29
  • 42
  • thanks for the reply, but i think it has nothing to do with idle connections. I am tracing the service process by setting a flag in a field in the database and then close the sql connection just right after. – krstn.m Sep 11 '12 at 07:09
  • It's not the DB connection that I'm talking about but the WCF Client's connection to the WCF Service. If the client is waiting for more than a minute to get a result from the service, the load balancer will kill the connection between the two as there is nothing happening over that connection. Even though the connection to the client has been stopped, the service can still carry on and finish what it is trying to do. – knightpfhor Sep 11 '12 at 22:16
  • Ok, I see. I'm just confused how the load balancer works. I am logging the WCF connection start and end time. When I access the WCF to process less data, which would run around 3 min, everthing would work fine. But when the process exceeds 5 minutes. The WCF will not respond and timed-out. – krstn.m Sep 12 '12 at 03:55