From efb8a30df282b2b6fc35a7e2a4350cdbd12fc65d Mon Sep 17 00:00:00 2001 From: Udi Dahan Date: Sat, 24 Aug 2024 00:12:36 +0300 Subject: [PATCH] Add links to Azure Service Bus where relevant (#33392) --- aspnetcore/fundamentals/best-practices.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aspnetcore/fundamentals/best-practices.md b/aspnetcore/fundamentals/best-practices.md index 5752f346d4..ee5a417a79 100644 --- a/aspnetcore/fundamentals/best-practices.md +++ b/aspnetcore/fundamentals/best-practices.md @@ -37,6 +37,7 @@ A common performance problem in ASP.NET Core apps is blocking calls that could b * **Do** call data access, I/O, and long-running operations APIs asynchronously if an asynchronous API is available. * **Do not** use to make a synchronous API asynchronous. * **Do** make controller/Razor Page actions asynchronous. The entire call stack is asynchronous in order to benefit from [async/await](/dotnet/csharp/programming-guide/concepts/async/) patterns. +* **Consider** using message brokers like [Azure Service Bus](/azure/service-bus-messaging/service-bus-messaging-overview) to offload long-running calls A profiler, such as [PerfView](https://github.com/Microsoft/perfview), can be used to find threads frequently added to the [Thread Pool](/windows/desktop/procthread/thread-pools). The `Microsoft-Windows-DotNETRuntime/ThreadPoolWorkerThread/Start` event indicates a thread added to the thread pool. @@ -132,7 +133,7 @@ Most requests to an ASP.NET Core app can be handled by a controller or page mode Recommendations: * **Do not** wait for long-running tasks to complete as part of ordinary HTTP request processing. -* **Do** consider handling long-running requests with [background services](xref:fundamentals/host/hosted-services) or out of process with an [Azure Function](/azure/azure-functions/). Completing work out-of-process is especially beneficial for CPU-intensive tasks. +* **Do** consider handling long-running requests with [background services](xref:fundamentals/host/hosted-services) or out of process possibly with an [Azure Function](/azure/azure-functions/) and/or using a message broker like [Azure Service Bus](/azure/service-bus-messaging/service-bus-messaging-overview). Completing work out-of-process is especially beneficial for CPU-intensive tasks. * **Do** use real-time communication options, such as [SignalR](xref:signalr/introduction), to communicate with clients asynchronously. ## Minify client assets