[Pgpool-general] connections not pooling

Johnny Tan johnnydtan at gmail.com
Fri Aug 19 15:17:18 UTC 2011


Thanks Tatsuo.

I originally started with that (num_init_children=16), but then when
all connections were used, even though they were idle, new connections
would hang forever. When I set client_idle_limit greater than 0, we
got errors like this:

PGError: ERROR: connection terminated due to client idle limit reached
server closed the connection unexpectedly This probably means the
server terminated abnormally before or while processing the request.

That's how we ended up with the higher number of init_children. Let me
go back to a slightly lower number, and see if we can find a balance.

Thanks,
johnny


On Fri, Aug 19, 2011 at 7:00 AM, Tatsuo Ishii <ishii at sraoss.co.jp> wrote:
> If you nee to limit connection to PostgreSQL less than 35, you need to
> lower num_init_children to less than 35.
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese: http://www.sraoss.co.jp
>
>> I setup pgpool-3.0.4 (config attached) in our staging environment. In
>> staging, we have 5 servers which make a total of 35 connections
>> (multiple rails thin webservers on each).
>>
>> In pgpool, I see 35 connections from the 5 servers. In the backend db,
>> I expected to see less than 35, but I don't. I see all 35 connections.
>>
>> Is this because the thin server makes a persistent connection? If so,
>> then pgpool won't help me in terms of pooling connections?
>>
>> johnny
>>
>> /etc/pgpool-II-90/pgpool.conf:
>>
>> listen_addresses = '*'
>> port = 9999
>> pcp_port = 9898
>> socket_dir = '/tmp'
>> pcp_socket_dir = '/tmp'
>> backend_socket_dir = '/var/run/pgpool-II-90'
>> pcp_timeout = 10
>> num_init_children = 40
>> max_pool = 6
>> child_life_time = 300
>> connection_life_time = 0
>> child_max_connections = 0
>> client_idle_limit = 0
>> authentication_timeout = 60
>> logdir = '/var/log/pgpool-II'
>> pid_file_name = '/var/run/pgpool-II-90/pgpool.pid'
>> replication_mode = false
>> load_balance_mode = false
>> replication_stop_on_mismatch = false
>> failover_if_affected_tuples_mismatch = false
>> replicate_select = false
>> reset_query_list = 'ABORT; DISCARD ALL'
>> white_function_list = ''
>> black_function_list = 'nextval,setval'
>> print_timestamp = true
>> master_slave_mode = false
>> master_slave_sub_mode = 'slony'
>> delay_threshold = 0
>> log_standby_delay = 'none'
>> connection_cache = true
>> health_check_timeout = 20
>> health_check_period = 0
>> health_check_user = 'nobody'
>> failover_command = ''
>> failback_command = ''
>> fail_over_on_backend_error = true
>> insert_lock = true
>> ignore_leading_white_space = true
>> log_statement = false
>> log_per_node_statement = false
>> log_connections = false
>> log_hostname = false
>> parallel_mode = false
>> enable_query_cache = false
>> pgpool2_hostname = ''
>> system_db_hostname = 'localhost'
>> system_db_port = 5432
>> system_db_dbname = 'pgpool'
>> system_db_schema = 'pgpool_catalog'
>> system_db_user = 'pgpool'
>> system_db_password = ''
>> backend_hostname0 = 'db-staging9'
>> backend_port0 = 5432
>> backend_weight0 = 1
>> backend_data_directory0 = '/var/db/postgresql/data'
>> enable_pool_hba = false
>> recovery_user = 'nobody'
>> recovery_password = ''
>> recovery_1st_stage_command = ''
>> recovery_2nd_stage_command = ''
>> recovery_timeout = 90
>> client_idle_limit_in_recovery = 0
>> lobj_lock_table = ''
>> ssl = false
>> debug_level = 1
>> _______________________________________________
>> Pgpool-general mailing list
>> Pgpool-general at pgfoundry.org
>> http://pgfoundry.org/mailman/listinfo/pgpool-general
>


More information about the Pgpool-general mailing list