Reputation: 41
I'm deploying my .net core 2.1 application on AWS Lambda, I'm using AspNetCoreServer Package for proxy routing to my controllers, and I found the problema on this solution, in my first request lambda is very slow for executing the action controller, but in anothers requests is fast, I look in CloudWatch logs for understand whats is happen and i saw in logs that the longest time is in ControllerActionInvoker: Route Match to invoke my action, I would to know if i did anything wrong or is .net core is slow for aws lambda.
My logs evidencies:
Thank you
Upvotes: 3
Views: 2096
Reputation: 2230
In fact the first slow request is not only caused by the lambda cold start. With .Net Core in lambda you have 2 cold start : the cold start of the lambda itself and the cold start of .net core itself. In order to avoid these 2 cold start you have to :
refer to this github issue to know more on the first slow request in .Net Core (still hope this problem will be fixed or better managed in next dotnet core releases, but right now you don't have better option)
Upvotes: 4
Reputation: 2210
Cold start (first lambda invocation) is not the specific problem of .Net Core. You can find a timing comparison for different languages in this article.
Upvotes: 1