Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
356 views
in Technique[技术] by (71.8m points)

php - Increase idle timeout

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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://docs.microsoft.com/en-us/azure/app-service-web/web-sites-create-web-jobs.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...