[pgpool-general: 4261] pgpool doesn't split the connections between the backends
the Rat
therat at abv.bg
Thu Dec 24 20:48:52 JST 2015
Hello Everyone,
Happy holidays! Can anyone assist on how to set-up pgpool to distribute connections between the backend database nodes , in other words to split the connection count between them. Currently it seems that every connection to pgpool in turn is a connection to every database backend.
Our setup is:
/----- postgresql - master pgpool--------postgresql - slave 1
\-----postgresql - slave 2
When I check the connections I get 60 to pgpool from the Tomcat client which pools that much and 60 to each of the database servers. How can I configure it so I have
20 per backend database node.
As this would be a really heavy loaded system with many DB connections we want to limit the connections to not more than 900 per server, as postgresql advise not to have more than 1000 connections per database, because performance radically drops. When the system gets under load and the connections reach 900 the backends start to reports "too many clients already", which triggers a "degeneration" of the node, which in pgpool terms means to take out the node from balancing and mark it with status "3". Isn't there a way to just keep 300 connections per server and a total of 900 from the client to pgpool only?
I can send my config if that helps:
listen_addresses = '0.0.0.0' port = 9999 socket_dir = '/tmp' listen_backlog_multiplier = 2 pcp_listen_addresses = '*' pcp_port = 9898 pcp_socket_dir = '/tmp' backend_hostname0 = '192.168.10.38' backend_port0 = 5432 backend_weight0 = 1 backend_data_directory0 = '/var/lib/pgsql/9.4/data' backend_flag0 = 'ALLOW_TO_FAILOVER' backend_hostname1 = '192.168.10.40' backend_port1 = 5432 backend_weight1 = 1 backend_data_directory1 = '/var/lib/pgsql/9.4/data' backend_flag1 = 'ALLOW_TO_FAILOVER' backend_hostname2 = '192.168.10.41' backend_port2 = 5432 backend_weight2 = 1 backend_data_directory2 = '/var/lib/pgsql/9.4/data' backend_flag2 = 'ALLOW_TO_FAILOVER' enable_pool_hba = on pool_passwd = 'pool_passwd' authentication_timeout = 60 ssl = on ssl_key = './server.key' ssl_cert = './server.crt' num_init_children = 3000 max_pool = 2 child_life_time = 600 child_max_connections = 0 connection_life_time = 0 client_idle_limit = 0 log_destination = 'stderr syslo
g' log_line_prefix = '%t: pid %p: '
# printf-style string to output at beginning of each log line. log_connections = off log_hostname = off log_statement = off log_per_node_statement = off log_standby_delay = 'none' syslog_facility = 'LOCAL0' syslog_ident = 'pgpool' debug_level = 1 log_error_verbosity = verbose
# terse, default, or verbose messages pid_file_name = '/var/run/pgpool/pgpool.pid' logdir = '/var/log/pgpool' connection_cache = off reset_query_list = 'ABORT; DISCARD ALL' replication_mode = off replicate_select = off insert_lock = on lobj_lock_table = '' replication_stop_on_mismatch = off failover_if_affected_tuples_mismatch = off load_balance_mode = on ignore_leading_white_space = on white_function_list = '' black_function_list = 'nextval,setval,nextval,setval' database_redirect_preference_list = '' app_name_redirect_preference_list = '' allow_sql_comments = off master_slave_mode = on master_slave_sub_mode = 'stream' sr_check_period = 0 sr_check_user = 'postgres' sr_check_password = 'hiddenpass' delay_threshold = 1000 follow_master_command = '/usr/local/pgsql/scripts/followmaster.sh %d %h %P %H 9898' health_check_period = 5 health_check_timeout = 20 health_check_user = 'postgres' health_check_password = 'hiddenpass' health_check_max_retries = 3
health_check_retry_delay = 2 connect_timeout = 10000 failover_command = '/usr/local/pgsql/scripts/failover.sh %d %H /var/lib/pgsql/9.4/data/mastertrigger.txt' failback_command = '/usr/local/pgsql/scripts/failback.sh %d %M' fail_over_on_backend_error = off search_primary_node_timeout = 10 recovery_user = 'postgres' recovery_password = '' recovery_1st_stage_command = '' recovery_2nd_stage_command = '' recovery_timeout = 90 client_idle_limit_in_recovery = 0 use_watchdog = on trusted_servers = '192.168.10.43,192.168.10.44' ping_path = '/bin' wd_hostname = '192.168.10.43' wd_port = 9000 wd_authkey = '' delegate_IP = '192.168.10.100' ifconfig_path = '/usr/bin' if_up_cmd = 'sudo /sbin/ifconfig
eth0:0 inet $_IP_$ netmask 255.255.255.0' if_down_cmd = 'sudo /sbin/ifconfig eth0:0
down' arping_path = '/usr/bin'
# arping command path arping_cmd = 'sudo /usr/sbin/arping -I eth0 -U $_IP_$ -w 1' clear_memqcache_on_escalation = on wd_escalation_command = '' wd_lifecheck_method = 'heartbeat' wd_interval = 10 wd_heartbeat_port = 9694 wd_heartbeat_keepalive = 2 wd_heartbeat_deadtime = 30 heartbeat_destination0 = '192.168.10.44' heartbeat_destination_port0 = 9694 heartbeat_device0 = 'eth0' wd_life_point = 3 wd_lifecheck_query = 'SELECT 1' wd_lifecheck_dbname = 'template1' wd_lifecheck_user = 'postgres' wd_lifecheck_password = 'hiddenpass' other_pgpool_hostname0 = '192.168.10.44' other_pgpool_port0 = 9999 other_wd_port0 = 9000 relcache_expire = 0 relcache_size = 256 check_temp_table = on check_unlogged_table = on memory_cache_enabled = off memqcache_method = 'shmem' memqcache_memcached_host = 'localhost' memqcache_memcached_port = 11211 memqcache_total_size = 67108864 memqcache_max_num_cache = 1000000 memqcache_expire = 0 memqcache_auto_cache_invalidation = on
memqcache_maxcache = 409600 memqcache_cache_block_size = 1048576 memqcache_oiddir = '/var/log/pgpool/oiddir' white_memqcache_table_list = '' black_memqcache_table_list = ''
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-general/attachments/20151224/2dbe6015/attachment.htm>
More information about the pgpool-general
mailing list