Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] [k8s] [Performanjce ]Force Tier1 compilation on start #110387

Open
yahorsi opened this issue Dec 4, 2024 · 3 comments
Open

[Question] [k8s] [Performanjce ]Force Tier1 compilation on start #110387

yahorsi opened this issue Dec 4, 2024 · 3 comments
Labels
area-TieredCompilation-coreclr untriaged New issue has not been triaged by the area owner

Comments

@yahorsi
Copy link

yahorsi commented Dec 4, 2024

Hi Guys,

We run a highly loaded app in Kubernetes and we see perf issues after releasing new versions, partially caused by the JIT compilation, we do have probes but it does not help.

Question: How can we force full app tier1 compilation on the startup? Startup duration is not a big deal as we have liveness probes and k8 will use prev version pods while new starts.

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Dec 4, 2024
@stephentoub
Copy link
Member

stephentoub commented Dec 4, 2024

You can disable tiered compilation such that everything will initially be compiled with full optimization:
https://learn.microsoft.com/en-us/dotnet/core/runtime-config/compilation#tiered-compilation

Just keep in mind that tiering isn't just about startup. By disabling tiering, you'll also be disabling throughput optimizations that depend on tiering, like dynamic PGO.

You could also explore getting the best of both worlds, using Ready To Run to precompile much of your app but allowing tiering / dynamic PGO to further optimize.

@yahorsi
Copy link
Author

yahorsi commented Dec 4, 2024

Thank you for the reply, disabling tiering won't make the whole app to JIT, my idea was that while the app in k8 starts it still. does not get any requests, so, we have time to fully JIT compile it and use the most optimized tier1, it's not a mobile app where startup time is critical, it's a k8 app that has a liveness probe, so we have time to make all possible optimizations to guarantee that when app responds to the liveness probe - it is fully ready and no any other warmup is needed.

@AndyAyersMS
Copy link
Member

We run a highly loaded app in Kubernetes and we see perf issues after releasing new versions, partially caused by the JIT compilation, we do have probes but it does not help.

I think we need to understand better what it is you're seeing. Can you share more details?

Thank you for the reply, disabling tiering won't make the whole app to JIT, my idea was that while the app in k8 starts it still. does not get any requests, so, we have time to fully JIT compile it and use the most optimized tier1,
 
PGO needs to observe the current instance of the app doing its normal processing. There is no way to short-circuit this. The initial observation period is what gives PGO the ability to focus its optimizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TieredCompilation-coreclr untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants