On Thu, Jul 16, 2015 at 06:06:11PM +0300, Marius Gologan wrote: > Once the scripts are done and disconnected from the DB server, TCP > connections will remain in TIME_WAIT. I've noticed that on my systems and > solve it by modifying the TCP parameters (reuse, recycle and timeout).
Sockets in TIME_WAIT are rarely a significant concern, and one should not generally retune the TCP stack to try to avoid them. In any case, this has little relevance to the OP's question around concurrency of established connections to the database. -- Viktor.