Increase idle timeout

时光怂恿深爱的人放手 提交于 2019-12-26 19:06:35

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/40900412/increase-idle-timeout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!