3 ms·
100%. > NET AOT with .NET 8 will dramatically improve the cold-start Don't get your hopes up on AOT. It still has lots of limitations, reflection being a big
by seabrookmx 3y ago
100%.
> NET AOT with .NET 8 will dramatically improve the cold-start
Don't get your hopes up on AOT. It still has lots of limitations, reflection being a big one. ASP.NET initialization relies heavily on reflection so it will be a while before we can have AOT compiled, HTTP microservices.
> I find the cold start already pretty good with .NET 7 on Google Cloud Run
Thanks for the tip! We're mostly using GKE but have a few services on Cloud Run that might benefit. Do you use the "always allocate CPU" option? We're seeing some memory creep we suspect would be solved by giving the GC cycles when a request isn't in flight.
- CharlieDigital 3y ago> ASP.NET initialization relies heavily on reflection Yes; the first thing I tried when .NET 7 went RTM was switch my web API over to AOT only to have it hang during build. .NET 8 AOT is specifically focused on ASP.NET; they've switched over many of the reflection paths to use source generation instead. I have hopes that some time during the .NET 8 lifecycle or .NET 9 horizon, we'll see full support: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/native-aot?view=aspnetcore-8.0 https://learn.microsoft.com/en-us/aspnet/core/fundamentals/n... > Do you use the "always allocate CPU" option? With the CPU Boost option, the cold start is really, really good. Whether you need a warm instance is up to your own threshold for latency on cold starts. I generally avoid using "always allocate CPU" because I'm cheap. The magic of Google Cloud and Cloud Run is really that you don't need to be always on.