Skip to content
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

High CPU Usage when using Payload as dependency in monorepo #11190

Open
sznski opened this issue Feb 14, 2025 · 1 comment
Open

High CPU Usage when using Payload as dependency in monorepo #11190

sznski opened this issue Feb 14, 2025 · 1 comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@sznski
Copy link

sznski commented Feb 14, 2025

Describe the Bug

I wanted to separate the CMS instance and its consuming applications into different services for Next.js apps. However, when using Payload as a dependency in another Next.js app, I noticed extremely high CPU usage. It spawns multiple Node.js processes in the background, causing my CPU temperature to reach around 100°C.

This issue occurs whenever a change is made in the code—each change spawns another Node.js process.
It could be an issue with my macOS environment or Node.js configuration, but I only experience this behavior when using Payload as a dependency.
Would be great if someone could reproduce this on their machine and confirm if it’s a general issue.

Link to the code that reproduces this issue

https://github.com/sznski/payload-high-cpu-usage

Reproduction Steps

  1. pnpm install -r in repo root
  2. pnpm dev in repo root
  3. just move around, try to login admin panel or just refresh page or wait for it
  4. change code, add console.log({posts}), console.log(posts.docs.length) and save files to refresh next

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Binaries:
  Node: 20.18.1
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.14.4
Relevant Packages:
  payload: 3.23.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:23 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6020
  Available memory (MB): 16384
  Available CPU cores: 12
@sznski sznski added status: needs-triage Possible bug which hasn't been reproduced yet validate-reproduction labels Feb 14, 2025
@sznski
Copy link
Author

sznski commented Feb 15, 2025

Probably webpack issue. Using --turbo flag in dev script fixes this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

No branches or pull requests

1 participant