【问题标题】:ServiceStack.Redis reading large files from Redis serverServiceStack.Redis 从 Redis 服务器读取大文件
【发布时间】:2013-10-27 15:34:38
【问题描述】:

我在测试 ServiceStack Redis 客户端时遇到了与 Windows Server 2003 R2 中的包大小有关的错误。

对于小于 30MB 的文件可以正常工作,但对于大于 32-33MB 的文件,它开始发送错误。而且它只发生在 Windows Server 2003 R2 中,我在 Windows 7 和 Windows 2008 R2 上测试成功。

代码:

String text = File.ReadAllText("file.xml");
String key = Guid.NewGuid().ToString();            
if (redisClient.Add(key, text, DateTime.Now.AddSeconds(300)))
    String Result = redisClient.Get<object>(key) as String;

错误:

System.Net.Sockets.SocketException (0x80004005): An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

有谁知道这是因为操作系统限制还是 Redis 的 ServiceStack 客户端的问题。

提前致谢。

【问题讨论】:

    标签: windows redis servicestack windows-server-2003 socketexception


    【解决方案1】:

    我也遇到过这个问题。虽然我确实在网上看到了与更改 TCP 窗口大小等相关的解决方案,但我只是压缩了所有内容。这并非在所有情况下都有效(尤其是在内容已经压缩的情况下!),但如果可以选择压缩,我会尝试。

    【讨论】:

      猜你喜欢
      • 2017-05-01
      • 2020-01-13
      • 2016-02-09
      • 2015-11-06
      • 2013-12-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多