<div dir="ltr">Hi,<div><br></div><div>I'm playing with pgpool2 and pgbench to understand how it behaves and which are the best conf.</div><div><br></div><div>I have a streaming replication of 3 nodes but I detached the 2 secondaries to test in simpler situation.</div><div>I created a db with pgbench -i -s 50</div><div>I set num_init_children = 800 and max_pool = 4</div><div>3200 max_connections on postgreSQL server</div><div>pgpool is on the same server of PostgreSQL</div><div>pgbench is on another machine</div><div>serialize_accept = on </div><div> <br></div><div>The first run works:<br><br># pgbench -p 5430 -c 400 -j 10 -T 15 --select-only -C test -U postgres -h adk-test-pg-c1                                                                     <br>pgbench (14.3 (Ubuntu 14.3-1.pgdg20.04+1), server 14.2 (Ubuntu 14.2-1.pgdg20.04+1))<br>starting vacuum...end.                                                                <br>transaction type: <builtin: select only>                                              <br>scaling factor: 50                                                                    <br>query mode: simple                                                                    <br>number of clients: 400                                                                <br>number of threads: 10                                                                 <br>duration: 15 s                                                                        <br>number of transactions actually processed: 18312<br>latency average = 328.168 ms                                                          <br>average connection time = 8.166 ms                                                    <br>tps = 1218.888945 (including reconnection times)<br><br></div><div>but if I launch a second run right after, it normally fails with a lot of </div><div><br></div><div>pgbench:pgbench: error:  error: connection to server at "adk-test-pg-c1" (10.1.201.21), port 5430 failed: Cannot assign requested address<br>        Is the server running on that host and accepting TCP/IP connections?<br></div><div><br></div><div>Thanks to serialize_accept = on, load average stays below 8 (number of cpu)</div><div><br></div><div>There are a lot of things I don't understand but the one that I really cannot understand is what changes between runs.</div><div>How is the system changed so that a second run fails?</div><div>I'd think it should be restored to the previous state.<br></div><div><br></div><div>I set  /proc/sys/net/ipv4/ip_local_port_range to 1025    65535  </div><div>(I have similar behaviour with pgbouncer)</div><div><br></div><div>Any help or reading suggestion is well accepted</div><div><br></div><div>TIA</div><div>Sandro</div><div>*:-)</div></div>