01-28-2020, 02:36 PM
Another possible cause of this issue is the config setting
<database>
...
<pool_max_connections>0</pool_max_connections>
...
</database>
For most installations, this setting should be 0. What this does is ensure that every request will open only the connection it uses and will close all of them when request exits. If it is not 0, then what will happen is that TACTIC will keep connections open across requests. This will occur for each database connected and for each thread of every python process. This can grow quite large if you have a large number of processes and /or projects. I would only recommend using this if latency to the database connections are a significant factor (we have observed this is Azure managed databases where connections to the database are unacceptably large and forcing a pool requirement)
As listy mentioned, you can increase the number of database connections for postgresql, but you may have to increase shared memory and semaphores. For Linux systems, we have used something like:
echo "134217728" >/proc/sys/kernel/shmmax
echo "134217728" >/proc/sys/kernel/shmall
Place an entry in /etc/sysctl.conf like,
kernel.shmmax=134217728
kernel.shmall=134217728
You can find more details on the Postgresql website.
<database>
...
<pool_max_connections>0</pool_max_connections>
...
</database>
For most installations, this setting should be 0. What this does is ensure that every request will open only the connection it uses and will close all of them when request exits. If it is not 0, then what will happen is that TACTIC will keep connections open across requests. This will occur for each database connected and for each thread of every python process. This can grow quite large if you have a large number of processes and /or projects. I would only recommend using this if latency to the database connections are a significant factor (we have observed this is Azure managed databases where connections to the database are unacceptably large and forcing a pool requirement)
As listy mentioned, you can increase the number of database connections for postgresql, but you may have to increase shared memory and semaphores. For Linux systems, we have used something like:
echo "134217728" >/proc/sys/kernel/shmmax
echo "134217728" >/proc/sys/kernel/shmall
Place an entry in /etc/sysctl.conf like,
kernel.shmmax=134217728
kernel.shmall=134217728
You can find more details on the Postgresql website.