Best way to use jobs/workers
I've created jobs/workers for most of the functions that are using external APIs (such as my SERP API or OpenAI) to ensure the task are properly executed.
Unfortunately, now, it happens sometimes that I run into problems with PGBoss and the Postgres DB saying that there are too many connections.
At the moment, I create a PBBoss instance for each job/worker.
Could you tell me if:
1) I should rather create one PGBoss instance per user session instead to reduce the number of connections?
2) I should rather avoid using jobs/workers for smaller tasks (that still use an external API but might take less time than others).
Would love to get your feedback on best practices here! Thanks
Unfortunately, now, it happens sometimes that I run into problems with PGBoss and the Postgres DB saying that there are too many connections.
At the moment, I create a PBBoss instance for each job/worker.
Could you tell me if:
1) I should rather create one PGBoss instance per user session instead to reduce the number of connections?
2) I should rather avoid using jobs/workers for smaller tasks (that still use an external API but might take less time than others).
Would love to get your feedback on best practices here! Thanks
