-2

I have an App service in Azure: a php script that makes a migration from a database (server1) to a another database (azure db in a virtual machine).

This script makes a lot of queries and requests, so it takes a lot of time and the server (App service) returns:

"500 - The request timed out. The web server failed to respond within the specified time."

I found that it's something about "idle timeout." I would like to know how to increase this time.

David Makogon
  • 69,407
  • 21
  • 141
  • 189

1 Answers1

0

In my test, I have tried the following so far:

  • Add ini_set('max_execution_time', 300); at the top of my PHP script.
  • App settings on portal: SCM_COMMAND_IDLE_TIMEOUT = 3600.

But nothing seems to work.

After some searching, I found the post by David Ebbo, as he said:

There is a 230 second (i.e. a little less than 4 mins) timeout for requests that are not sending any data back. After that, the client gets the 500 you saw, even though in reality the request is allowed to continue server side.

And the similar thread from SO, you can refer here.

The suggestion for migration is that you can leverage Web Jobs to run PHP scripts as background processes on App Service Web Apps. For more details, you can refer to https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-create-web-jobs.

Community
  • 1
  • 1
Aaron Chen
  • 9,835
  • 1
  • 16
  • 28