问题描述
我在Azure中有一个应用程序服务:一个php脚本,可以从数据库(server1)迁移到另一个数据库(虚拟机中的Azure db).
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:
我发现这与空闲超时"有关.我想知道如何增加这次的时间.
I found that it's something about "idle timeout." I would like to know how to increase this time.
推荐答案
在我的测试中,到目前为止,我已经尝试了以下方法:
In my test, I have tried the following so far:
- 在我的PHP脚本顶部添加
ini_set('max_execution_time', 300);
. - 门户网站上的应用设置:
SCM_COMMAND_IDLE_TIMEOUT = 3600
.
- 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:
与SO中的类似主题一样,您可以在此处 a>.
And the similar thread from SO, you can refer here.
有关迁移的建议是,您可以利用Web Jobs
来运行PHP脚本作为App Service Web Apps上的后台进程.有关更多详细信息,您可以参考 https://docs.microsoft.com/zh-CN/azure/app-service-web/web-sites-create-web-jobs .
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.
这篇关于增加空闲超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!