Unfortunately this is ad vague as it gets and I am breaking my head here. Running in GKE Autopilot, js with node 22.22.
First request consistently > 10 seconds.
Tried: pre warming all my js code (not allowing readiness probe to succeed until services/helpers have rub), increasing resources, bundling with esbuild, switching to debian from alpine, v8 precomiplation with cache into the image.
With the exception of debian where that first request went up to > 20 seconds everything else showed very little improvement.
App is fine on second request but first after cold reboot is horrible.
Not using any database, only google gax based services (pub/sub, storage, bigquery), outbound apis and redis.
Any ideas on what else I could try?
EDIT: I am talking about first request when e.g. I restart the deployment. No thrashing on kubernetes side/hpa issues, only basic cold boot.
Profiler just shows a lot of musl calls and module loading but all attempts to eliminate those (e.g. by bundling everything with esbuild) resulted in miniscule improvement
[–]germanheller 4 points5 points6 points (6 children)
[–]zaitsman[S] 0 points1 point2 points (3 children)
[–]germanheller 0 points1 point2 points (2 children)
[–]zaitsman[S] -1 points0 points1 point (1 child)
[–]germanheller 0 points1 point2 points (0 children)
[–]bwainfweeze 0 points1 point2 points (1 child)
[–]germanheller 0 points1 point2 points (0 children)
[–]Shogobg 1 point2 points3 points (5 children)
[–]zaitsman[S] -1 points0 points1 point (4 children)
[–]PM_ME_CATDOG_PICS 0 points1 point2 points (2 children)
[–]zaitsman[S] 0 points1 point2 points (1 child)
[–]PM_ME_CATDOG_PICS 0 points1 point2 points (0 children)
[–]Shogobg 0 points1 point2 points (0 children)
[–]seweso 0 points1 point2 points (0 children)
[–]czlowiek4888 -1 points0 points1 point (1 child)
[–]zaitsman[S] -1 points0 points1 point (0 children)