gpt4 book ai didi

postgresql - PgBouncer 不启动最小连接数

转载 作者:行者123 更新时间:2023-11-29 12:18:10 25 4
gpt4 key购买 nike

我在 pgBouncer 中设置了这个限制

max_client_conn = 2000

default_pool_size = 40

当我在 phpPgAdmin 中执行此 SQL 时,只出现 2 或 4 个连接:

SELECT datname, usename, pid, query, query_start
FROM pg_catalog.pg_stat_activity
WHERE datname='example'
ORDER BY usename, pid

这是正常现象还是 pgBouncer 在启动时没有加载 .ini?

最佳答案

pg_stat_activity 中的连接数取决于实际负载。它也更多地依赖于 pool_mode - 如果您有 pool_mode = session,您会看到更多的 session ,因为它们的发布频率较低且速度较慢。

关于您的选择,请查看 docs (允许 - 是关键字):

default_pool_size

How many server connections to allow per user/database pair. Can be overridden in the per-databaseconfiguration.

Default: 20

max_client_conn

Maximum number of client connections allowed. When increased then the file descriptor limits should also be increased.Note that actual number of file descriptors used is more thanmax_client_conn.

强调我的。

关于postgresql - PgBouncer 不启动最小连接数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41787246/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com