-
Notifications
You must be signed in to change notification settings - Fork 42
[BUG] High CPU usage on releases after 0.5.12 #600
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
Comments
Could you provide a reproduction ? |
See https://nextjs.org/docs/app/deep-dive/caching for some explanation on caching. Basically caching allow to generate the page once and serve it for a period of time. It should offload your server. There is nothing we can do without seeing your app code. Please create a minimal repro and add a link to the repository here. Thanks. |
Again, to make progress on this issue, we need:
Without that there is nothing we can do and will close the issue. Thanks! |
Hi @vicb , I will try to create a minimal repo with issue and get back (will update this post) Update: I am able to 'sort of' reproduce it with
![]() Under the red line is with version 1.0.0-beta (actually 0.6.0 shows the same) and above with 0.5.12. The high number is browser making first request, which seems to be very slow (why?) and the subsequent requests are faster. So with 0.6.0 first slow request is 2-3x compared to 0.5.12, subsequent requests are fast with both - which also corresponds to the graphs above P50 being fast but P90+ being slow. |
This must be because we dynamically import the server handler in the worker vs a static import before (as suggested by @conico974). So the time was actually spent before but in the init (i.e. you should see wall time > cpu time in that case). A few notes:
|
Describe the bug
After migrating from 0.5.12 to 1.0.0.beta3, I noticed very high cpu usage in my app requests.
It went down when I rolled back to 0.5.12
Metrics view from dashboard

Steps to reproduce
App is very simple, completely SSG with around 20 pages
open-next.config.ts (version 0.5.12) - NEXT_INC_CACHE_KV is not defined (does this disable caching?)
open-next.config.ts (version 1.0.0-beta.3) - no cache binding defined
PS: I am new to Next.js/Cloudflare but even after reading the docs multiple times, I have not really understood how this cache is really working and what purpose is serving - if anyone can point me to a more verbose write up or video. Thanks!
Expected behavior
CPU is not 20x
@opennextjs/cloudflare version
1.0.0-beta.3
Wrangler version
4.12.0
next info output
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.3.0: Thu Jan 2 20:24:06 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 22.14.0 npm: 11.3.0 Yarn: 1.22.22 pnpm: N/A Relevant Packages: next: 15.3.1 // Latest available version is detected (15.3.1). eslint-config-next: 15.3.1 react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.3 Next.js Config: output: N/A
Additional context
No response
The text was updated successfully, but these errors were encountered: