Open heliohm opened 1 year ago
I edited the firebase-tools frameworks/index.js build script and added the Google Cloud Profiler and Trace Agent before deploying again.
The tracing is set up according to this guide: https://nextjs.org/docs/app/building-your-application/optimizing/open-telemetry.
Findings are:
Addition: GCP tripped the billing budget set up throughout development without any usage beyond a developer. Metrics Explorer show Cloud Run Revision -> Container -> Billable Instance Time going at 16 mins/min (whatever that means) and ramping up almost 10$/day, with zero active instances. Seems something is hanging beyond the user's control here?
Not really a resolution to this issue, but I've also spent hours figuring this out. The cloud function memory is being exhausted, even if I increase it.
It's also annoying to realize that the documentation stated that the latest supported Next.js version is 13.4.7, and it wasn't even shown during deployment.
Might be related to https://github.com/FirebaseExtended/firebase-framework-tools/pull/122.
[REQUIRED] Environment info
firebase-tools: 12.5.2
Platform: MacOS 13.2.1 , MBP Pro M2 Pro,
[REQUIRED] Test case
https://github.com/heliohm/next-firebase-debug-latency
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
NextJS SSR cloud function latency is typically 1-200ms after cold start
[REQUIRED] Actual behavior