2

问题在于每日计划中长时间运行的 azure webjob。每次运行需要 2-4 小时进行数据分析。唯一的依赖关系是通过 EF 和 Azure 存储使用 Azure SQL 数据库,只需在 App.Config 上设置 AzureWebJobsDashboard 和 AzureWebJobsStorage 连接,在 VS 上使用 webjob SDK 进行标准设置。webjob 的大部分时间都被 EF 的 SaveChanges() 所消耗。我还使用大约 3000 行控制台输出进行大量日志记录以监控进度。Web 应用程序配置为 Allways ON,并且 WEBJOBS_IDLE_TIMEOUT 设置为非常高的数字。

以下是错误日志:

[10/20/2016 07:48:17 > 492c46: ERR] 未处理的异常:Microsoft.WindowsAzure.Storage.StorageException:客户端无法在指定的超时时间内完成操作。---> System.TimeoutException:客户端无法在指定的超时时间内完成操作。

[10/20/2016 07:48:17 > 492c46: ERR ] --- 内部异常堆栈跟踪结束 ---

[10/20/2016 07:48:17 > 492c46: ERR] 在 Microsoft.WindowsAzure.Storage.Core.Util.StorageAsyncResult`1.End()

[10/20/2016 07:48:17 > 492c46: ERR ] 在 Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob.EndUploadText(IAsyncResult asyncResult)

[10/20/2016 07:48:17 > 492c46: ERR ] 在 Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.<>c__DisplayClass4.b__3(IAsyncResult ar)

4

2 回答 2

1

这是几个月大的,但对于那些后来...

你提到你做了很多日志记录。记录了一个处理类似问题的问题。显然,WebJobs SDK 会定期将日志数据保存到 Blob 存储中。如果您使用大量带宽或以其他方式消耗大量资源,您可能会遇到 SDK 尝试保存到 blob 存储的超时。请注意堆栈跟踪中的上传调用。

我在一个惩罚电线的过程中偶尔看到这一点,所以我正在通过 WebJobs 日志记录工具禁用日志记录。

于 2017-01-04T19:16:52.113 回答
0

A triggered webjob is aborted if it is idle, has no cpu time or output for a certain amount of time. Try and increase it by setting configuration WEBJOBS_IDLE_TIMEOUT to a large number, for instance 3600.

It could also be aborted if your instances hasn't configured Always on.

If that doesn't help you should try handle the amount of logging. Could it be that you try and write to many messages to fast? Have a look at this answer to see if that coould be the case.

于 2016-10-20T19:22:09.160 回答