首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用Tcp在Akka IO中增加Tcp块大小

如何使用Tcp在Akka IO中增加Tcp块大小
EN

Stack Overflow用户
提问于 2015-05-28 04:48:09
回答 1查看 657关注 0票数 0

我正在使用Akka-Cluster,并通过Tcp使用Akka IO通过网络发送大型对象。数据正在被切成非常小的块。通过“已接收”消息接收的数据ByteString的大小非常小(约7KB)。有什么配置设置可以让我一次发送和接收更大的ByteStrings吗?

EN

回答 1

Stack Overflow用户

发布于 2015-05-29 18:15:15

接收到的ByteString的大小可以在application.conf文件中配置。以下是默认配置:

代码语言:javascript
复制
akka.io.tcp {
      # The number of bytes per direct buffer in the pool used to read or write
      # network data from the kernel.
      direct-buffer-size = 128 KiB

      # The maximal number of direct buffers kept in the direct buffer pool for
      # reuse.
      direct-buffer-pool-limit = 1000

      # The maximum number of bytes delivered by a `Received` message. Before
      # more data is read from the network the connection actor will try to
      # do other work.
      # The purpose of this setting is to impose a smaller limit than the 
      # configured receive buffer size. When using value 'unlimited' it will
      # try to read all from the receive buffer.
      max-received-message-size = unlimited
}

尝试更改这些设置。由于max-received-message-size缺省为无限制,您的问题可能是由缓冲区大小引起的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/30492842

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档