fwrite(): send of 8192 bytes failed with errno=104 Connection reset by peer

大兔子大兔子 提交于 2019-12-03 07:03:24

问题:fwrite(): send of 8192 bytes failed with errno=104 Connection reset by peer

问题描述

通过mysql + sphinx做的一个检索功能,之前一直没什么问题,最近检索时有部分检索失败,查看日志后报错为 fwrite(): send of 8192 bytes failed with errno=104 Connection reset by peer。

 

问题分析

查看代码部分,fwrite() 打开的资源为fsockopen(),通过fsockopen连接sphinx,将数据写入到sphinx服务端。

最终发现问题出在sphinx服务端,由于检索的数据太大,在请求sphinx服务端时,发送的包数据超过了sphinx可接受的最大值,导致以上问题。

 

解决方法

修改sphinx.conf中max_packet_size(最大允许的网络包大小)的设置值以解决问题。

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!