IP分配:
192.168.100.108 db1
192.168.100.109 db2
192.168.100.222 vip
服务器配置:(两台服务器配置相同)
[root@db2 ~]# uname -a
Linux db2 3.8.13-98.7.1.el7uek.x86_64 #2 SMP Wed Nov 25 13:51:41 PST 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@db2 ~]# free -m
total used free shared buff/cache available
Mem: 128568 1046 122488 3511 5033 123749
Swap: 32767 0 32767
[root@db2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 100G 8.0G 92G 9% /
devtmpfs 63G 0 63G 0% /dev
tmpfs 63G 88K 63G 1% /dev/shm
tmpfs 63G 3.5G 60G 6% /run
tmpfs 63G 0 63G 0% /sys/fs/cgroup
/dev/sda6 485G 33M 484G 1% /soft
/dev/sda2 500G 961M 499G 1% /hg
/dev/sda1 497M 189M 309M 38% /boot
/dev/sdb1 985G 4.6G 980G 1% /hgdata
tmpfs 13G 16K 13G 1% /run/user/42
tmpfs 13G 0 13G 0% /run/user/0
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -T 10 highgo ---VIP插入
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 1
number of threads: 1
duration: 10 s
number of transactions actually processed: 349
latency average: 28.706 ms
tps = 34.835714 (including connections establishing)
tps = 35.086471 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.108 -p 5866 -T 10 highgo ---public ip插入
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 1
number of threads: 1
duration: 10 s
number of transactions actually processed: 7267
latency average: 1.376 ms
tps = 726.696294 (including connections establishing)
tps = 726.860636 (excluding connections establishing)
highgo=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------
0 | db1 | 5866 | up | 0.500000 | primary | 359 | true | 0
1 | db2 | 5866 | up | 0.500000 | standby | 0 | false | 0
(2 rows)
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -c 10 -S -T 30 highgo --VIP查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 5356
latency average: 56.119 ms
tps = 178.193115 (including connections establishing)
tps = 180.596120 (excluding connections establishing)
highgo=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------
0 | db1 | 5866 | up | 0.500000 | primary | 3576 | true | 0
1 | db2 | 5866 | up | 0.500000 | standby | 2140 | false | 0
(2 rows)
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -c 10 -S -T 30 highgo --VIP查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 5356
latency average: 56.119 ms
tps = 178.193115 (including connections establishing)
tps = 180.596120 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.108 -p 5866 -c 10 -S -T 30 highgo --public ip查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 1213577
latency average: 0.247 ms
tps = 40452.247094 (including connections establishing)
tps = 40482.473769 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.109 -p 5866 -c 10 -S -T 30 highgo --备机查询(流复制+pgpool)
starting vacuum...错误: 无法在恢复期间执行VACUUM
192.168.100.108 db1
192.168.100.109 db2
192.168.100.222 vip
服务器配置:(两台服务器配置相同)
[root@db2 ~]# uname -a
Linux db2 3.8.13-98.7.1.el7uek.x86_64 #2 SMP Wed Nov 25 13:51:41 PST 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@db2 ~]# free -m
total used free shared buff/cache available
Mem: 128568 1046 122488 3511 5033 123749
Swap: 32767 0 32767
[root@db2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 100G 8.0G 92G 9% /
devtmpfs 63G 0 63G 0% /dev
tmpfs 63G 88K 63G 1% /dev/shm
tmpfs 63G 3.5G 60G 6% /run
tmpfs 63G 0 63G 0% /sys/fs/cgroup
/dev/sda6 485G 33M 484G 1% /soft
/dev/sda2 500G 961M 499G 1% /hg
/dev/sda1 497M 189M 309M 38% /boot
/dev/sdb1 985G 4.6G 980G 1% /hgdata
tmpfs 13G 16K 13G 1% /run/user/42
tmpfs 13G 0 13G 0% /run/user/0
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -T 10 highgo ---VIP插入
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 1
number of threads: 1
duration: 10 s
number of transactions actually processed: 349
latency average: 28.706 ms
tps = 34.835714 (including connections establishing)
tps = 35.086471 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.108 -p 5866 -T 10 highgo ---public ip插入
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 1
query mode: simple
number of clients: 1
number of threads: 1
duration: 10 s
number of transactions actually processed: 7267
latency average: 1.376 ms
tps = 726.696294 (including connections establishing)
tps = 726.860636 (excluding connections establishing)
highgo=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------
0 | db1 | 5866 | up | 0.500000 | primary | 359 | true | 0
1 | db2 | 5866 | up | 0.500000 | standby | 0 | false | 0
(2 rows)
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -c 10 -S -T 30 highgo --VIP查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 5356
latency average: 56.119 ms
tps = 178.193115 (including connections establishing)
tps = 180.596120 (excluding connections establishing)
highgo=# show pool_nodes;
node_id | hostname | port | status | lb_weight | role | select_cnt | load_balance_node | replication_delay
---------+----------+------+--------+-----------+---------+------------+-------------------+-------------------
0 | db1 | 5866 | up | 0.500000 | primary | 3576 | true | 0
1 | db2 | 5866 | up | 0.500000 | standby | 2140 | false | 0
(2 rows)
[highgo@db2 ~]$ pgbench -h 192.168.100.222 -p 9999 -c 10 -S -T 30 highgo --VIP查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 5356
latency average: 56.119 ms
tps = 178.193115 (including connections establishing)
tps = 180.596120 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.108 -p 5866 -c 10 -S -T 30 highgo --public ip查询
starting vacuum...end.
transaction type: SELECT only
scaling factor: 1
query mode: simple
number of clients: 10
number of threads: 1
duration: 30 s
number of transactions actually processed: 1213577
latency average: 0.247 ms
tps = 40452.247094 (including connections establishing)
tps = 40482.473769 (excluding connections establishing)
[highgo@db2 ~]$ pgbench -h 192.168.100.109 -p 5866 -c 10 -S -T 30 highgo --备机查询(流复制+pgpool)
starting vacuum...错误: 无法在恢复期间执行VACUUM