How many pool connection size should be set for a 1000 users Jira system? For a Jira system, if use Jira's default connection configuration as below:

&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;jira-database-config&gt;
  &lt;name&gt;defaultDS&lt;/name&gt;
  &lt;delegator-name&gt;default&lt;/delegator-name&gt;
  &lt;database-type&gt;postgres72&lt;/database-type&gt;
  &lt;schema-name&gt;public&lt;/schema-name&gt;
  &lt;jdbc-datasource&gt;
    &lt;url&gt;jdbc:postgresql://[IP]:5432/jiradb&lt;/url&gt;
    &lt;driver-class&gt;org.postgresql.Driver&lt;/driver-class&gt;
    &lt;username&gt;jiradbuser&lt;/username&gt;
    &lt;password&gt;{PASSWORD}&lt;/password&gt;
    &lt;pool-min-size&gt;20&lt;/pool-min-size&gt;
    &lt;pool-max-size&gt;20&lt;/pool-max-size&gt;
    &lt;pool-max-wait&gt;30000&lt;/pool-max-wait&gt;
    &lt;validation-query&gt;select 1&lt;/validation-query&gt;
    &lt;min-evictable-idle-time-millis&gt;60000&lt;/min-evictable-idle-time-millis&gt;
    &lt;time-between-eviction-runs-millis&gt;300000&lt;/time-between-eviction-runs-millis&gt;
    &lt;pool-max-idle&gt;20&lt;/pool-max-idle&gt;
    &lt;pool-remove-abandoned&gt;true&lt;/pool-remove-abandoned&gt;
    &lt;pool-remove-abandoned-timeout&gt;300&lt;/pool-remove-abandoned-timeout&gt;
    &lt;pool-test-on-borrow&gt;false&lt;/pool-test-on-borrow&gt;
    &lt;pool-test-while-idle&gt;true&lt;/pool-test-while-idle&gt;
  &lt;/jdbc-datasource&gt;
&lt;/jira-database-config&gt;


In postgresql's config file:

postgresql.conf

max_connections = 300
shared_buffers = 80MB


In /etc/sysctl.conf file:

kernel.shmmax=100663296


At test stage, it can work. But in the production environment, for 1000 users use this system, if one app server serve 500 users, how many pool connection size is good to set in the postgresql.conf file?
And, if use pgbouncer, how many connections it can be reduced?
The answer depends on how many cores you have on your database system, how many concurrent I/O requests it can handle and what the ratio of active versus idle time is while the application is using a connection.

I would start with a maximum of 20 sessions.