Description
Link to reproduction
No response
Payload Version
3.0.0-beta.68
Node Version
v20.11.1
Next.js Version
Describe the Bug
I'm using postgres 12, and static generation with getStatisProps
combined with local api of getPayloadHMR
Having 32 statically generated pages I encounter a problem that the last few pages are not generated right away, worker for generation terminates and restarts, finishing page generation. On second screenshot you can see a peak of postgres connections - max 100 for my system - in idle state, after peak drops, that's when workers are terminated, restarted and finished. This works after some optimizations I've made, because before that, SSG were failing with too many clients
from postgres.
Is this an intended behavior and I should scale connections as count of my pages growth or that's going something wrong with how connections are managed in local api?
Reproduction Steps
When I will have time maybe I will try to create an example repo, but rough reproduction:
- Get a postgress db - set max_connection to 100 or less.
- Create a bunch of pages
- Try generate with
next build
Adapters and Plugins
db-postgres