Postgresql错误:无法从客户端接收数据:连接重置由对等

我试试这个栈:nginx + uwsgi + django + postgresql,请求可以到达django的视图,客户端显示500 server internal fault ,我查了postgres日志,发现错误could not receive data from client: Connection reset by peer 。 如何debugging呢?

我发现原因,在我的uwsgiconfiguration文件中,我将thread = 2设置为master = trueprocesses = 4 ,现在运行良好。

那么,如何debugging呢? 我google 的错误 ,这告诉我这不是postgresql错误,客户端应用程序丢弃连接到数据库,在这个堆栈上: nignx <-> uwsgi <-> django <-> postgresql ,所以也许隐藏在nginx,uwsgi或djagno,我检查nginx日志和uwsgi日志,没有logging错误。 我的朋友build议我使用pycharm来远程debuggingdjango,我在debugging服务器上debugging过django,django没问题。 然后我检查uwsgi的configuration,发现一个新手的错…