增加空闲超时 [英] Increase idle timeout

查看:95
本文介绍了增加空闲超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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:

"500-请求超时.Web服务器无法在以下时间内响应 指定的时间."

"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.

推荐答案

在我的测试中,到目前为止,我已经尝试了以下方法:

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:

有230秒(即不到4分钟)的超时时间 不发回任何数据的请求.之后,客户 获得您看到的500,即使实际上请求被允许 继续服务器端.

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.

与SO中的类似主题一样,您可以在此处 a>.

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

有关迁移的建议是,您可以利用Web Jobs来运行PHP脚本作为App Service Web Apps上的后台进程. 有关更多详细信息,您可以参考

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.

这篇关于增加空闲超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆