[pgpool-general: 4605] Re: Using Amazon RDS Replication with pgpool - bad performance though

Roman D dostick at gmail.com
Sat Apr 2 00:02:50 JST 2016


RDS is only a managed database hosting. Basically server and database running on it packaged into “RDS instance” and managed for you.
When you create RDS instance or Master-Slave, you still connect to plain Postgres. There’s no balancer middleware provided by Amazon. 
 They have Elastic Load Balancer but that is more like low-level packet router, nothing to do with databases.

> On 1 Apr 2016, at 8:49 PM, Dennis Gearon <gearond at gmail.com> wrote:
> 
> I thought Amazon RDS handles all that for you automatically? Specifically load balancing to the second machine
> 
> On Apr 1, 2016 2:49 AM, "Roman D" <dostick at gmail.com <mailto:dostick at gmail.com>> wrote:
> Hello,
> 
> Amazon RDS Master and Read replica.
> The goal is to have Read queries balanced to Read Replica using pgpool, while Replication is provided by RDS.
> 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.
> 
> But surprisingly this configuration works!
> Using combination of these parameters:
> replication_mode = off
> load_balance_mode = on
> master_slave_mode = on
> master_slave_sub_mode = ‘stream'
> 
> pgpool 3.3.4
> Master configured in pgpool.paswd as 0 and replica as 1
> 
> Here’s the conf:
> 
> backend_hostname0 = ‘master’
> backend_port0 = 5432
> backend_weight0 = 1
> backend_flag0 = ‘DISALLOW_TO_FAILOVER’
> 
> backend_hostname1 = ’slave’
> backend_port1 = 5432
> backend_weight1 = 1
> backend_flag1 = ‘DISALLOW_TO_FAILOVER'
> 
> enable_pool_hba = on
> pool_passwd = ‘pool_passwd'
> ssl = off
> 
> num_init_children = 200
> max_pool = 4
> child_life_time = 300
> child_max_connections = 2000
> connection_life_time = 300
> client_idle_limit = 0
> listen_backlog_multiplier = 5
> 
> connection_cache = on
> reset_query_list = ‘ABORT; DISCARD ALL'
> 
> replication_mode = off
> load_balance_mode = on
> master_slave_mode = on
> master_slave_sub_mode = 'stream'
> sr_check_period = 0
> 
> parallel_mode = off
> health_check_period = 0
> use_watchdog = off
> memory_cache_enabled = off
> 
> 
> The problem is that pgpool is up to 4 times slower then direct connection to database.
> Without pgpool database roundtrip is 10 msec. With pgpool it’s 30-40 msec.
> 
> pgpool is hosted on separate machine form the application and database. PGPool machine CPU is at 5% ( net.core.somaxconn set to 5000)
> application CPU/memory is at 50% and database CPU&memory is at 50% load
> so basically pgpool is being the bottleneck, doing something that slows down the database access.
> 
> I tried changing every possible parameter, changing num_init_children, max_pool - that does not improve anything.
> 
> 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.
> 
> Thank you!
> 
> 
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net <mailto:pgpool-general at pgpool.net>
> http://www.pgpool.net/mailman/listinfo/pgpool-general <http://www.pgpool.net/mailman/listinfo/pgpool-general>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20160401/cad69561/attachment.html>


More information about the pgpool-general mailing list