我創建了一個.NET CORE控制檯應用程序,並作爲連續模式webjob上載到Azure應用程序(ASP.NET Core)。使用webjob運行時,webapp響應API請求的響應非常慢(請求時間上升到幾秒)。Webjob導致ASP.NET核心性能問題
WebJob代碼
static void Main(string[] args)
{
queueClient.RegisterMessageHandler(
async (message, token) =>
{
// Process the message
// Complete the message so that it is not received again.
// This can be done only if the queueClient is opened in ReceiveMode.PeekLock mode.
await queueClient.CompleteAsync(message.SystemProperties.LockToken);
},
new MessageHandlerOptions(exce => {
return Task.CompletedTask;
})
{ MaxConcurrentCalls = 1, AutoComplete = false });
//Console.ReadKey();
while (true) ;
}
和消息操作花費幾秒鐘的處理。
我想這個代碼是有效的.Net完整的框架,.NET Core不還有WebJob SDK支持。看起來你的答案基於WebJob SDK。使用.NET Core,我們必須手動管理所有內容。 – tssutha
3.0 beta版本與Net Standard 2.0兼容,所以它應該可以工作。 – juunas
我會看看,我還沒有將應用程序更新到.Net Core 2.0,但正如我們試驗的那樣,我們遇到了EF核心2.0的一些問題,等待修復錯誤。 – tssutha