sindresorhus / p-queue

Promise queue with concurrency control
MIT License
3.39k stars 182 forks source link

Doc request: Why is "concurrency" not working as expected? #178

Closed bf closed 1 year ago

bf commented 1 year ago

Hey everyone, thanks for this great library.

The last hours I have debugged an issue where I set concurrency for p-queue to 40 but only had 5 processes running at a time. Now I noticed that the node-postgres database connection also has a max_connections setting which was at 5.

Maybe we could add a section to the FAQ to point out that even though p-queue concurrency is set high, other things like database driver max connections can influence how many jobs run at a time.

Thanks!

jbialobr commented 1 year ago

It would be good if you could provide some repro that would allow to validate the above statement (if the library is used properly).

bf commented 1 year ago

We can close this issue. I just wanted to point out that node-postgres / pg can limit p-queue to 5 concurrent tasks unless max_connections for node-postgres is set to at least as large as the p-queue concurrency option.