Next.js Discord

Discord Forum

CPU spikes in production NextJS

Answered
Alligator mississippiensis posted this in #help-forum
Open in Discord
Alligator mississippiensisOP
We are having consistent spikes in CPU usage (up to 100%) in our deployed NextJS app in production.
We don't have heavy processing of any kind of data, just some carousels with images and not-so-long pages with text in them.
Has someone faced a similar issue? We are working on improving the logs to identify the problem but nothing came up so far.
Could it have something to do with images resizing? I use he NextJS Image component.
Any hint is much appreciated.
Thank you!
Answered by Alligator mississippiensis
It turned out to be a problem about not encoding search parameters on dynamic routing. It was making a search including S&P 500 but it wasn't URI encoded. So it was trying to render 8k+ results from searching "S" 😅
View full answer

1 Reply

Alligator mississippiensisOP
It turned out to be a problem about not encoding search parameters on dynamic routing. It was making a search including S&P 500 but it wasn't URI encoded. So it was trying to render 8k+ results from searching "S" 😅
Answer