我将我的项目从 python tornado 重写为 go(使用 iris 框架)。基本功能测试正常。当我在高并发下测试时。应用程序总是停止一段时间然后出现错误:
(dial tcp 192.168.1.229:6543: getsockopt: connection timed out)
6543 端口是与 pgbouncer 一起使用的 postgresql 端口……pgbouncer 和 postgresl 进程运行正常。
另外,我发现 memcache 连接有时会超时(memcache 进程仍在工作)。
发生这种情况是因为连接太多吗?或者一些连接没有按时关闭?我怎样才能避免这个问题?