<p dir="ltr">I thought Amazon RDS handles all that for you automatically? Specifically load balancing to the second machine</p>
<div class="gmail_quote">On Apr 1, 2016 2:49 AM, &quot;Roman D&quot; &lt;<a href="mailto:dostick@gmail.com">dostick@gmail.com</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Amazon RDS Master and Read replica.<br>
The goal is to have Read queries balanced to Read Replica using pgpool, while Replication is provided by RDS.<br>
I thought that my case is pretty common, but there’s no mention anywhere on the net or in this list of someone ever done this.<br>
<br>
But surprisingly this configuration works!<br>
Using combination of these parameters:<br>
replication_mode = off<br>
load_balance_mode = on<br>
master_slave_mode = on<br>
master_slave_sub_mode = ‘stream&#39;<br>
<br>
pgpool 3.3.4<br>
Master configured in pgpool.paswd as 0 and replica as 1<br>
<br>
Here’s the conf:<br>
<br>
backend_hostname0 = ‘master’<br>
backend_port0 = 5432<br>
backend_weight0 = 1<br>
backend_flag0 = ‘DISALLOW_TO_FAILOVER’<br>
<br>
backend_hostname1 = ’slave’<br>
backend_port1 = 5432<br>
backend_weight1 = 1<br>
backend_flag1 = ‘DISALLOW_TO_FAILOVER&#39;<br>
<br>
enable_pool_hba = on<br>
pool_passwd = ‘pool_passwd&#39;<br>
ssl = off<br>
<br>
num_init_children = 200<br>
max_pool = 4<br>
child_life_time = 300<br>
child_max_connections = 2000<br>
connection_life_time = 300<br>
client_idle_limit = 0<br>
listen_backlog_multiplier = 5<br>
<br>
connection_cache = on<br>
reset_query_list = ‘ABORT; DISCARD ALL&#39;<br>
<br>
replication_mode = off<br>
load_balance_mode = on<br>
master_slave_mode = on<br>
master_slave_sub_mode = &#39;stream&#39;<br>
sr_check_period = 0<br>
<br>
parallel_mode = off<br>
health_check_period = 0<br>
use_watchdog = off<br>
memory_cache_enabled = off<br>
<br>
<br>
The problem is that pgpool is up to 4 times slower then direct connection to database.<br>
Without pgpool database roundtrip is 10 msec. With pgpool it’s 30-40 msec.<br>
<br>
pgpool is hosted on separate machine form the application and database. PGPool machine CPU is at 5% ( net.core.somaxconn set to 5000)<br>
application CPU/memory is at 50% and database CPU&amp;memory is at 50% load<br>
so basically pgpool is being the bottleneck, doing something that slows down the database access.<br>
<br>
I tried changing every possible parameter, changing num_init_children, max_pool - that does not improve anything.<br>
<br>
I am about to give up. Please help! Is there anything else I can look into ?It would be amazing if this worked without adding such significant time overhead.<br>
<br>
Thank you!<br>
<br>
<br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</blockquote></div>