gpt4 book ai didi

pgbouncer - 是什么导致 pgbouncer 的 avg_wait_time > 0?

转载 作者:行者123 更新时间:2023-12-02 04:25:40 24 4
gpt4 key购买 nike

文档将 avg_wait_time 描述为:

Time spent by clients waiting for a server in microseconds (average per second).



我们偶尔会看到 avg_wait_time 出现峰值(通常为 0)。在这些高峰期间,我能说的最好的是,有可用/空闲的服务器。在这些情况下,什么可能导致等待时间大于 0?

最佳答案

hackernoon 读取流程导致您的连接池耗尽,新连接需要等到空闲位置可用于连接到池,或者进入执行阶段。

These server connections, that clients get linked to, are “pooled” — limited in number and reused. Because of that it might occur that while client sends some request (beginning a transaction or performing a query) a corresponding server connection pool is exhausted, i.e. pgbouncer oppened as many connections as were allowed it and all of them are occupied by (linked to) some other clients. PgBouncer in this scenario puts client into a queue, and this client’s connection goes to a CL_WAITING state. This might happen as well while client only logging in, so there’s CL_WAITING_LOGIN for that also: enter image description here

关于pgbouncer - 是什么导致 pgbouncer 的 avg_wait_time > 0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54697377/

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