连接被对等重置/由于 Postgres 连接过多而损坏管道

Mah*_*oni 5 postgresql networking connection-pooling go psql

使用sqlx几个并发连接时,我很快遇到了Too many open connections. 限制db.DB.MaxOpenConnections实际上消除了问题并激活了我所希望的连接池。

\n\n

现在,在一些机器上,我们在测试中观察到,该测试准确地测试了太多打开的连接不会发生不同的错误:

\n\n
read tcp [::1]:54883->[::1]:5432: read: connection reset by peer\nread tcp [::1]:54886->[::1]:5432: read: connection reset by peer\nread tcp [::1]:54884->[::1]:5432: read: connection reset by peer\nread tcp [::1]:54887->[::1]:5432: read: connection reset by peer\nread tcp [::1]:54885->[::1]:5432: read: connection reset by peer\nread tcp [::1]:54888->[::1]:5432: read: connection reset by peer\n\xe2\x80\xa6\n
Run Code Online (Sandbox Code Playgroud)\n\n

Postgres 日志没有透露任何信息。这有可能发生在网络堆栈上吗?我还能做什么来调试这个?我无法在本地重现它。

\n