csredis
csredis copied to clipboard
劳烦看看,这个问题:Unable to read data from the transport connection: Connection timed out
环境为linux内网127.0.0.1
foreach (var memModel in list)
{
try
{
CsRedisHelper.QueueSet<TemplateMessageData>("TemplateMessageData", new TemplateMessageData()
{
tmType = TemplateMessageType.服务恢复通知_SendServiceOnNotice,
p0 = memModel.gzhAppId,
p1 = memModel.gzhOpenId,
p2 = title,
p3 = name,
p4 = t1,
p5 = t2,
p6 = remark
});
}
catch(Exception ex)
{
LogHelper.Log("", ex.Message + "\r\n" + ex.StackTrace, "reids异常");
Thread.Sleep(1000);
}
}
差不多2.8w条数据插入list的时候 旧出现了这个问题 Unable to read data from the transport connection: Connection timed out
想问问 该如何处理 在服务器上就报错 本地windows10测试 5w数据都没有问题
连接超时了,检查网络是否通畅
用的是127.0.0.1:6379 这个不可能是网络问题吧
建议实际行动排查一下
不管是csredis 还是freeredis我都试了,采用独立的机器,在centos上的并发能力远远弱于windows机器。我采用quartz创建了200个task来写入redis的list,当作日志队列,在linux上运行一会就超时, 不管是linux宿主机还是k8s pod 还是docker都这样。 【192.168.0.214/7】Next recovery time:2022-10-14 下午4:18:50 【192.168.0.214/7】Recovered windows的 win 10、win 2012 都没报错。 600个task都顶住了。
加上本身是用作队列,因此有个logstash在读取,他一直没报错,因此这个锅不能甩给linux系统,估计还是dotnet core在这块有问题。
跟网络防火墙策略有关