2016/01/16 18:02:20 [error] 4077#0: *1678 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select...--146 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:20 [error] 4077#0: *1682 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select...--144 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:20 [error] 4077#0: *1686 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select....--246 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:20 [error] 4077#0: *1690 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select....--247 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:30 [error] 4077#0: *1923 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select....--313 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:30 [error] 4077#0: *1924 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select....--311 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
2016/01/16 18:02:30 [error] 4077#0: *1926 postgres: connection failed: FATAL: sorry, too many clients already
while connecting to PostgreSQL database, client: 192.168.204.1, server: localhost, request: "GET /opensql001?sql=select....--320 HTTP/1.1", upstream: "postgres://192.168.204.101:5432", host: "192.168.204.101"
发送时间: 2016-01-14 10:45
主题: Re: Re: [openresty] ngx_postgresql 模块的并发超时问题
Hello!
2016-01-13 18:23 GMT-08:00 haitaosoft:
> 下载openresty最新版本,加入poll配置编译,再测试真的没问题了!
> pgsql配置的最大连接数由1200改为100,也没出现504错误了。
> 难道真的是pgsql的libpq有bug?
是的,PostgreSQL 的 libpq 的非阻塞接口的实现不够健壮,对于边沿触发的事件模型有已知的
bug,会导致其处理状态机陷于无限等待。我们以前就遇到过。
> 记得先编译安装了一个9.4版本,最近9.5出来后,直接下载安装了一个run
> 不过客户端库可能还是9.2.14的。。。。
> 同一台机器,服务端已经是9.4、9.5了,不知道怎么让客户端也升级为9.5
> 为了更新pgsql客户端,搜到一个apt-get更新的,于是去找centos下的apt。。。
你可以尝试从官方最新的源码直接编译 libpq,但我不确定官方最新的 libpq 是否真的就没有问题了,呵呵。
>
> 额外问一句:poll的效率极高
> 为什么nginx不是以poll为默认方式,而是要重新编译才支持?
> 应该默认编译支持poll,实际是否采用,才通过配置来决定
>
poll 的效率其实还不够高,否则大家就不必再搞 kqueue, epoll 这些高级的事件接口了,呵呵。
Nginx 在 Linux 上面默认只编译效率最高的 epoll 接口,而 *BSD 风格的系统上则只编译那些平台上最高效的 kqueue
接口。只有在 Windows 上目前默认使用 select,效率还不及 poll,呵呵。
Regards,
-agentzh
--
--
邮件来自列表“openresty”,专用于技术讨论!
订阅: 请发空白邮件到 openresty+subscribe@googlegroups.com
发言: 请发邮件到 openresty@googlegroups.com
退订: 请发邮件至 openresty+unsubscribe@googlegroups.com
归档: http://groups.google.com/group/openresty
官网: http://openresty.org/
仓库: https://github.com/agentzh/ngx_openresty
教程: http://openresty.org/download/agentzh-nginx-tutorials-zhcn.html