Compartilhar via


ASP.NET Core 1.0 slow perf issues on Azure App Service Web Apps

ASP.NET Core 1.0 applications may experience intermittent hangs when hosted in Azure App Service

If you are noticing intermittent hangs or an error message that says, "The specified CGI Application encountered an error and the server terminated the process." in your ASP.NET Core 1.0 app hosted in Azure App Service, you may be running into a known issue.

This issue is fixed in 1.0.2 version of Kestrel that is included in .NET Core 1.0.3 update. Please make sure you update your app dependencies to use 1.0.2 version of Kestrel to resolve this issue. Alternatively, you can use one of the two workarounds below.

Workaround 1

Set Kestrel’s ThreadCount to 1. Here is a code snippet.

  var host = new WebHostBuilder()

              .UseKestrel(options =>

              {

                  options.ThreadCount = 1;

              })

              .UseContentRoot(Directory.GetCurrentDirectory())

              .UseIISIntegration()

              .UseStartup<Startup>()

              .Build();

Workaround 2

Upgrade to ASP.NET Core 1.1. For more information, including steps to update an existing project to ASP.NET Core 1.1, please see here.