问题
The processes would be running 24*7 and will be re-started periodically (like once in a week).
In this case which is a better option :
Opening a postgres connection per processes which will persist until the life of the process.
Opening a postgres connection pool and sharing it among the processes.
回答1:
The main objective is that there are not too many PostgreSQL connections at the same time, otherwise the danger increases that toi many of them will become active at the same time, thereby overloading the database.
So as long as you have some 20 processes, you can keep things simple and have a persistent connection per process. With many processes, you need a connection pool.
来源:https://stackoverflow.com/questions/59766207/i-am-executing-n-no-of-processes-where-n-is-could-be-between-5-50-each-proce