[zz] pgpool-II load balancing from FAQ
It seems my pgpool-II does not do load balancing. Why?
First of all, pgpool-II' load balancing is "session base", not "statement base". That means, DB node selection for load balancing is decided at the beginning of session. So all SQL statements are sent to the same DB node until the session ends. Another point is, whether statement is in an explicit transaction or not. If the statement is in a transaction, it will not be load balanced in the replication mode. In pgpool-II 3.0 or later, SELECT will be load balanced even in a transaction if operated in the master/slave mode.
-
Note the method to choose DB node is not LRU or some such. Pgpool-II chooses DB node randomly considering the "weight" parameter in pgpool.conf. This means that the chosen DB node is not uniformly distributed among DB nodes in short term. You might want to inspect the effect of load balancing after ~100 queries have been sent.Also cursor statements are not load balanced in replication mode. i.e.:DECLARE..FETCH are sent to all DB nodes in replication mode. This is because the SELECT might come with FOR UPDATE/FOR SHARE. Note that some applications including psql could use CURSOR for SELECT. For example, from PostgreSQL 8.2, if "\set FETCH_COUNT n" is executed, psql unconditionaly uses a curor named "_psql_cursor".
How can I observe the effect of load balancing?
- We recommend to enable "log_per_node_statement" directive in pgpool.conf for this. Here is an example of the log:
-
-- :: LOG: pid : DB node id: backend pid: statement: SELECT abalance FROM pgbench_accounts WHERE aid = ;
The "DB node id: 1" shows which DB node was chosen for this loadbalancing session. Please make sure that you start pgpool-II with "-n" option to get pgpool-II log. (or you can use syslog in pgpool-II 3.1 or later)
[zz] pgpool-II load balancing from FAQ的更多相关文章
- 【架构】How To Use HAProxy to Set Up MySQL Load Balancing
How To Use HAProxy to Set Up MySQL Load Balancing Dec 2, 2013 MySQL, Scaling, Server Optimization U ...
- CF# Educational Codeforces Round 3 C. Load Balancing
C. Load Balancing time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- Codeforces Educational Codeforces Round 3 C. Load Balancing 贪心
C. Load Balancing 题目连接: http://www.codeforces.com/contest/609/problem/C Description In the school co ...
- UVA 12904 Load Balancing 暴力
Load Balancing Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/vi ...
- Load Balancing 折半枚举大法好啊
Load Balancing 给出每个学生的学分. 将学生按学分分成四组,使得sigma (sumi-n/4)最小. 算法: 折半枚举 #include <iostrea ...
- How Network Load Balancing Technology Works--reference
http://technet.microsoft.com/en-us/library/cc756878(v=ws.10).aspx In this section Network Load Balan ...
- Network Load Balancing Technical Overview--reference
http://technet.microsoft.com/en-us/library/bb742455.aspx Abstract Network Load Balancing, a clusteri ...
- How Node.js Multiprocess Load Balancing Works
As of version 0.6.0 of node, load multiple process load balancing is available for node. The concept ...
- NGINX Load Balancing – TCP and UDP Load Balancer
This chapter describes how to use NGINX Plus and open source NGINX to proxy and load balance TCP and ...
随机推荐
- MyBatis之六:缓存
MyBatis 3中的缓存实现的很多改进都已经实现了,使得它更加强大而且易于配置.默认情况下是没有开启缓存的,除了局部的session缓存,可以增强变现而且处理循环依赖也是必须的.要开启二级缓存,你需 ...
- Spark Core源代码分析: Spark任务运行模型
DAGScheduler 面向stage的调度层,为job生成以stage组成的DAG,提交TaskSet给TaskScheduler运行. 每个Stage内,都是独立的tasks,他们共同运行同一个 ...
- centos6.x已经安装的系统添加图形界面
yum groupinstall "X Window System" yum groupinstall GNOME Desktop Environment
- iOS开发——数据持久化&使用NSUserDefaults来进行本地数据存储
使用NSUserDefaults来进行本地数据存储 NSUserDefaults适合存储轻量级的本地客户端数据,比如记住密码功能,要保存一个系统的用户名.密码.使用NSUserDefaults是首 ...
- UNIX标准化及实现之限制
前言 UNIX系统实现定义了很多幻数和常量,其中有很多已被硬编码(关于硬编码和软编码:http://www.cnblogs.com/chenkai/archive/2009/04/10/1432903 ...
- cvsnt 设置用户、修改密码
忘记密码后,可以用administrator 新建一个用户,使用这个用户的账号. password agent 设置clear password不好使.. cvsnt配置 创建用户1 .下载cvs ...
- Windows下用Eclipse搭建C/C++开发环境
本文假定你已经熟悉Java,Eclipse的安装,并能顺利启动和运行Eclipse.此外因为各软件版本在不断更新,有些地方可能不准确,以最新的.原文资料为准. 距上一次写和调C++程序,已经5.6年了 ...
- Jquery小实例
1正反选 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...
- 大四找实习(web前端),加油
大四很奇妙,课程变少了,事情却繁杂了. 大三暑假去学驾照,在很多人看来太迟了(毕竟身边很多人跑去实习了),包括我自己.学驾照特别费时间,尤其是对即将大四,希望用实习充实自己的我来说.考虑再三,终于决定 ...
- 错误与修复:ASP.NET无法检测IE10,导致_doPostBack未定义JavaScript错误,恒处于FF5卷动条位置
浏览器版本号继续升级过程中.IE9诞生了,IE10 也即将问世,火狐5和6已经发布了,而7和8也快出现了,Opera已经到了11,Chrome还在继续,我也不知道,应该总在14和50之间吧.不管怎样, ...