dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

dotnetcore 2.2 performance issues test with wrk #18872

Closed agussang closed 4 years ago

agussang commented 4 years ago

Describe the bug

I was deploy simple MVC with dotnetcore 2.2 build with docker and test with wrk tools, i got issue on performance.

This with dotnetcore 3.1 image

This with dotnetcore 2.2 image

that's view low max request.

this my code WebApplication.zip

This my dockerfile configuration FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS build-env WORKDIR /app EXPOSE 80 EXPOSE 443

Copy csproj and restore as distinct layers

COPY .config ./ COPY .csproj ./ RUN dotnet restore

Copy everything else and build

COPY . ./ RUN dotnet publish -c Release -o out

Build runtime image

FROM microsoft/dotnet:aspnetcore-runtime WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "WebApplication3.dll"]

To Reproduce

Further technical details

javiercn commented 4 years ago

@agussang thanks for contacting us.

@sebastienros can you help out here?

javiercn commented 4 years ago

@agussang I would like to mention that 2.2 is out of support as per our current support policies. You should consider migrating forward to 3.1 or going back to 2.1 which is LTS and will be supported up until August 2021. See here for details.

agussang commented 4 years ago

@agussang I would like to mention that 2.2 is out of support as per our current support policies. You should consider migrating forward to 3.1 or going back to 2.1 which is LTS and will be supported up until August 2021. See here for details.

so no solution for this issue? actually dotnet 2.2 have bad performance?

agussang commented 4 years ago

@agussang thanks for contacting us.

@sebastienros can you help out here?

@sebastienros bro, i’m need solution here. Help me

sebastienros commented 4 years ago

Your test on 2.2 shows that most requests timed out. I think there is a problem on your application. Can you try to do a curl instead of a wrk? And enable logging on your app to see what's happening if the curl fails too.

agussang commented 4 years ago

Your test on 2.2 shows that most requests timed out. I think there is a problem on your application. Can you try to do a curl instead of a wrk? And enable logging on your app to see what's happening if the curl fails too.

Hy @sebastienros i’m build my apps on docker, how to enable debug logging for showing error timeout? Can you open my apps, this just simple mvc and i run on dotnet 3.1 is getting nice RPS, but if i try on 2.2 or 3.0 i got small RPS stuck on max 20rps, actually i have code production with 2.2, before i’m update to 3.1 i try to find solution for 2.2, because to many effort if i rewrite my code to 3.1, i’m just trying migrate from iis to container base, so i must build my code on docker. I need your help, i know you’re pro about dotnet and master dotnet. Thanks

agussang commented 4 years ago

@javiercn so this is bug or something ?

agussang commented 4 years ago

@sebastienros i wash try hit and i get this log, showing high latency 2980.4061ms

info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1] Executing ObjectResult, writing value of type 'System.String'. info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) in 2980.4061ms info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1] Executed endpoint 'WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3)' info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 5321.496ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET https://localhost:32768/api/values info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 9214.8166ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1] Executing ObjectResult, writing value of type 'System.String'. info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1] Executed endpoint 'WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3)' info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) in 1654.4833ms info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3] Route matched with {action = "GetCountryAsync", controller = "Values"}. Executing controller action with signature System.Threading.Tasks.Task1[System.String] GetCountryAsync() on controller WebApplication3.Controllers.ValuesController (WebApplication3). info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) in 2265.6815ms info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1] Executed endpoint 'WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3)' info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3] Route matched with {action = "GetCountryAsync", controller = "Values"}. Executing controller action with signature System.Threading.Tasks.Task1[System.String] GetCountryAsync() on controller WebApplication3.Controllers.ValuesController (WebApplication3). info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action method WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 9.9015ms. info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] Executing action method WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) - Validation state: Valid info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 5372.2242ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor[1] Executing ObjectResult, writing value of type 'System.String'. info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) in 3545.6569ms info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[1] Executing action method WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3) - Validation state: Valid info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[3] Route matched with {action = "GetCountryAsync", controller = "Values"}. Executing controller action with signature System.Threading.Tasks.Task`1[System.String] GetCountryAsync() on controller WebApplication3.Controllers.ValuesController (WebApplication3). info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 8419.8924ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker[2] Executed action method WebApplication3.Controllers.ValuesController.GetCountryAsync (WebApplication3), returned result Microsoft.AspNetCore.Mvc.ObjectResult in 41.702ms. info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 6153.213ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2] Request finished in 5388.0482ms 200 text/plain; charset=utf-8 info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1] Request starting HTTP/1.1 GET https://localhost:32768/api/values

sebastienros commented 4 years ago

I now realize that you already shared some repro app, I will try it locally with these two versions.

sebastienros commented 4 years ago

@agussang I can't find any GetCountryAsync method in the WebApplication3 that you shared. Which web app (there are 3) and which endpoint do you want me to test to repro the issue?

JunTaoLuo commented 4 years ago

There haven't been any response so I'm closing this issue as stale.