<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div>Team,<br><br></div>We want to set up a High availability with Postgres and while doing the research found PGPool is a great tool. But we are finding difficulty to achieve on what we want.<br><br></div>Current Setup : <br><br></div>App server : RoR with unicorn + nginx<br></div>DB : Postgresql Master and Slave<br></div>Middleware : PGPool 3.6.2<br><br></div>Configuration : <br><br></div>Webserver : 4cores with 14G memory , 30 unicorn workers and DBpool :800. Totally 3 servers with Azure load balancer<br><br></div>DB server : 16cores with 28GB Both Master and Slave (DB has 25million record, mix match of transnational &amp; web application )<br><br></div>PGpool Confugration : 4cores with 28GB memory. configuration are below.<br><br>#------------------------------------------------------------------------------<br># CONNECTION POOLING<br>#------------------------------------------------------------------------------<br><br>connection_cache = on<br>                                   # Activate connection pools<br>                                   # (change requires restart)<br><br>                                   # Semicolon separated list of queries<br>                                   # to be issued at the end of a session<br>                                   # The default is for 8.3 and later<br>reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>                                   # The following one is for 8.2 and before<br>#reset_query_list = &#39;ABORT; RESET ALL; SET SESSION AUTHORIZATION DEFAULT&#39;<br><br><br><br>#------------------------------------------------------------------------------<br># POOLS<br>#------------------------------------------------------------------------------<br><br># - Concurrent session and pool size -<br><br>num_init_children = 3000<br>                                   # Number of concurrent sessions allowed<br>                                   # (change requires restart)<br>max_pool = 2<br>                                   # Number of connection pool caches per connection<br>                                   # (change requires restart)<br><br># - Life time -<br><br>#child_life_time = 300<br>child_life_time = 60<br>                                   # Pool exits after being idle for this many seconds<br>child_max_connections = 1000<br>                                   # Pool exits after receiving that many connections<br>                                   # 0 means no exit<br>connection_life_time = 60<br>                                   # Connection to backend closes after being idle for this many seconds<br>                                   # 0 means no close<br>client_idle_limit = 60<br>                                   # Client is disconnected after being idle for that many seconds<br>                                   # (even inside an explicit transactions!)<br>                                   # 0 means no disconnection<br><br><br></div>Rest as default. <br><br><br></div><div>From the above setup we are trying hit the concurrent users of 4k... But at some point of time PGpool load got increased and memory is fully occupied even if i increase the Memory full memory got occupied. This resulting requests slow down and request per second throughput and failures.</div><div><br></div><div><br></div><div>But without PGpool directly connecting to Master works fine without errors and much better throughput. <br></div><div><br></div><div>We would like to scale 20k concurrent users with PGPool setup. We would like to know whether PGpool is enterprise standard to work on.. Else we have to look for other solutions.  <br></div><div><br></div><div>Or are we missing anything in Pgpool configuration. Please let us know.<br></div><div><div><div><div><div><div><div><div><div><div><div><div><div><br>-- <br><div class="gmail_signature"><br>Regards,<br>Rishi<br></div>
</div></div></div></div></div></div></div></div></div></div></div></div></div></div>