SSR preload/warmup? #26768
Unanswered
jpage-godaddy
asked this question in
Help
SSR preload/warmup?
#26768
Replies: 1 comment
-
Hello, I've also seen this problem. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We've got a bit of an unusual problem. We are deploying a next.js to a Kubernetes cluster which seemingly has a very poorly performing file system. The issue we experience is that the Kubernetes liveness probe which calls a health check in our custom server is timing out. It appears that the root issue is that the SSR for the first request for a particular page in the newly-spawned app is doing an event-loop-blocking 16 seconds task which interferes with this probe request completing in a timely manner, and the pod gets marked as unresponsive and is killed.
In profiling what's going on, it appears a large require dependency tree crawling is what's to blame, and since that's a synchronous process it's blocking other requests. The module being loaded is part of a page component's dependencies. Because the FS is so slow and the dependency tree so large, that's causing problems.
Is there a way to force a preloading of all server-side bundles given a
next
instance that we can invoke prior to having our pods going live? We may be able to work around by having a "warmup" process that invokes our pages by making a bunch of HTTP requests to stimulate the first SSR beforehand, but if there's a more direct way we can do this we could integrate that technique into our company's app shell.Would us manually requiring every JS bundle under
.next/server
accomplish the task of preloading?Beta Was this translation helpful? Give feedback.
All reactions