[pgpool-general: 3413] Re: Load Balancing Question

Yugo Nagata nagata at sraoss.co.jp
Wed Jan 7 20:04:40 JST 2015


Hi scott,

> backend_hostname1 = ‘xxx.xxx.xx.xxx'
>                                    # Host name or IP address to connect to for backend 0
> backend_port1 = 5432
>                                    # Port number for backend 0
> backend_weight0 = 0
   ~~~~~~~~~~~~~~~~~~

This should be backend_weight1.
                                    ^^

>                                    # Weight for backend 0 (only in load balancing mode)
> backend_data_directory1 = '/data'
>                                    # Data directory for backend 0
> backend_flag1 = 'DISALLOW_TO_FAILOVER'
>                                    # Controls various backend behavior
>                                    # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOV

On Sat, 3 Jan 2015 23:19:43 +0000
Scott Rankin <srankin at motus.com> wrote:

> Hi all,
> 
> I’ve got a setup where I have a PostgreSQL 9.2.9 master on the US East Coast and a streaming replication slave on the US West Coast.  I’m trying out a setup where we run pgPool in the same data center as the slave, directing all reads to the slave and all writes to the master.
> 
> I have pgPool set up for Master/Slave mode, with configuration as below.  Everything seems to work except I’m not seeing any SELECT queries sent to the slave.  I don’t see any messages about replication being behind (and load is pretty low at the moment).  I’ve also pasted the debug output from when I execute the query.
> 
> Any suggestions would be appreciated!
> 
> Config Snippet:
> 
> # - Backend Connection Settings -
> backend_hostname0 = ‘xxx.xxx.xxx.xxx'
>                                    # Host name or IP address to connect to for backend 0
> backend_port0 = 5432
>                                    # Port number for backend 0
> backend_weight0 = 1
>                                    # Weight for backend 0 (only in load balancing mode)
> backend_data_directory0 = '/data'
>                                    # Data directory for backend 0
> backend_flag0 = 'DISALLOW_TO_FAILOVER'
>                                    # Controls various backend behavior
>                                    # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
> 
> backend_hostname1 = ‘xxx.xxx.xx.xxx'
>                                    # Host name or IP address to connect to for backend 0
> backend_port1 = 5432
>                                    # Port number for backend 0
> backend_weight0 = 0
>                                    # Weight for backend 0 (only in load balancing mode)
> backend_data_directory1 = '/data'
>                                    # Data directory for backend 0
> backend_flag1 = 'DISALLOW_TO_FAILOVER'
>                                    # Controls various backend behavior
>                                    # ALLOW_TO_FAILOVER or DISALLOW_TO_FAILOVER
> 
> master_slave_mode = on
>                                    # Activate master/slave mode
>                                    # (change requires restart)
> master_slave_sub_mode = 'stream'
>                                    # Master/slave sub mode
> 
> Log Snippet:
> 
> 2015-01-03 23:09:38 DEBUG: pid 177: ProcessFrontendResponse: kind from frontend Q(51)
> 2015-01-03 23:09:38 DEBUG: pid 177: pool_unset_doing_extended_query_message: done
> 2015-01-03 23:09:38 DEBUG: pid 177: statement2: select count(*) from users;
> 2015-01-03 23:09:38 DEBUG: pid 177: pool_set_query_in_progress: done
> 2015-01-03 23:09:38 DEBUG: pid 177: pool_has_insertinto_or_locking_clause: returns 0
> 2015-01-03 23:09:38 DEBUG: pid 177: send_to_where: 2 query: select count(*) from users;
> 2015-01-03 23:09:38 DEBUG: pid 177: function_call_walker: function name: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^currval$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^lastval$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^nextval$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^setval$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_miles_log_aml$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_miles_log$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: pattern_compare: black_function_list (^update_db_info$) not matched: count
> 2015-01-03 23:09:38 DEBUG: pid 177: system_catalog_walker: relname: users
> 2015-01-03 23:09:38 DEBUG: pid 177: temp_table_walker: relname: users
> 2015-01-03 23:09:38 DEBUG: pid 177: make_table_name_from_rangevar: tablename:users
> 2015-01-03 23:09:38 DEBUG: pid 177: unlogged_table_walker: relname: users
> 2015-01-03 23:09:38 DEBUG: pid 177: wait_for_query_response: waiting for backend 1 completing the query
> 
> This email message contains information that Motus, LLC considers confidential and/or proprietary, or may later designate as confidential and proprietary. It is intended only for use of the individual or entity named above and should not be forwarded to any other persons or entities without the express consent of Motus, LLC, nor should it be used for any purpose other than in the course of any potential or actual business relationship with Motus, LLC. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify sender immediately and destroy the original message.
> 
> Internal Revenue Service regulations require that certain types of written advice include a disclaimer. To the extent the preceding message contains advice relating to a Federal tax issue, unless expressly stated otherwise the advice is not intended or written to be used, and it cannot be used by the recipient or any other taxpayer, for the purpose of avoiding Federal tax penalties, and was not written to support the promotion or marketing of any transaction or matter discussed herein.


-- 
Yugo Nagata <nagata at sraoss.co.jp>


More information about the pgpool-general mailing list