SaaS Deployment: warmup site before swicthing slot

Hey,

We have a website deployed to Kentico SaaS which relies on data layer cache for stable performance. At the moment, we experience issues when the website restarts - it takes about 10-15 minutes to warmup cache properly (content model is extremely heavy here) and for the website to become fast again.

Currently, every deployment (even "zero-time") causes availability issues because technically it requires restart of the web app and switch of slots during deployment. I was wondering, is it possible to run any custom warmup script (requesting a number of pages to fill up the caches) after deployment to a slot but before the actual switch of slots? According to docs it only does a simple request just to make sure the slot is up, but not necessarily populate the caches. Are there any workarounds anyone has tried here?

Thanks, Dmitry

Tags:
SaaS
2

Answers

From what I discussed with Sean a while back, there's no direct post-deployment hook on SaaS. The slot swap appears to do only a basic warmup/status check to verify the app started correctly. That may have changed since, but I haven't seen anything newer in the docs.

That said, since this is needed after every restart anyway, ApplicationEvents.Initialized could be a reasonable trigger point. The one thing I'd watch out for is doing it synchronously. If warmup takes 10-15 minutes, blocking startup that long could interfere with the swap validation and potentially cause the deployment to fail. Kicking it off as a background task would let the app come up cleanly while the cache warms in parallel.

Also worth considering whether you even need to go through full page requests for this, or whether running the underlying content queries would be enough to prime the relevant caches. That would also avoid any edge cases around request handling not being fully ready at that exact point in the lifecycle.

0

I'm not positive, but this upcoming improvement for SaaS environments might help.

I believe the current default URL (application root) is used to validate the slot deployment succeeded. You could supply a custom URL endpoint that kicks off cache initialization and responds with a 200 if the application is healthy.

I'll update this response when I have more information.

0

To response this discussion, you have to login first.