2013-01-04 43 views
0

我已經安裝了帶有2個後端的pgpool 3.2.1,使用負載均衡和連接池的流式複製模式。我做了一些高負載測試,以便讓pgpool連接更好。pgpool連接被凍結

Suposing該規則是正確的:max_pool * num_init_children < =(MAX_CONNECTIONS - superuser_reserved_connections的)

測試1:

num_init_children = 90 max_pool = 1

(僅在主) max_connections = 100 superuser_reserved_connections = 3

psql -U postgres的結果 - C '從和pg_stat_activity SELECT COUNT' 是90.

試驗2:

num_init_children = 90 max_pool = 2

(僅在主) MAX_CONNECTIONS = 100個 superuser_reserved_connections的= 3

psql -U postgres -c'pg_stat_activity'中的SELECT COUNT'的結果是91.其他6個連接會發生多達97個連接?這是我可以訪問postgresql的最大連接數。

在這兩種情況下,我都會得到pgpoolAdmin中使用的所有連接,並且數據庫連接被凍結,並且不允許新連接。

謝謝!

回答

0

在pgpool他們使用下面的規則來控制連接:

max_pool * num_init_children < =(MAX_CONNECTIONS - superuser_reserved_connections的)(消除不需要查詢) max_pool * num_init_children * 2 < =(MAX_CONNECTIONS - superuser_reserved_connections的) (查詢取消需要)

所以,問題是當你有取消查詢時,你必須在postgresql中設置在pgpool中配置的連接數的雙倍。