欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2023-02-03 16:35:05
问题:fwrite(): send of 8192 bytes failed with errno=104 Connection reset by peer 问题描述 通过mysql + sphinx做的一个检索功能,之前一直没什么问题,最近检索时有部分检索失败,查看日志后报错为 fwrite(): ......

问题: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(最大允许的网络包大小)的设置值以解决问题。