我正在使用Akka-Cluster,并通过Tcp使用Akka IO通过网络发送大型对象。数据正在被切成非常小的块。通过“已接收”消息接收的数据ByteString的大小非常小(约7KB)。有什么配置设置可以让我一次发送和接收更大的ByteStrings吗?
发布于 2015-05-29 18:15:15
接收到的ByteString的大小可以在application.conf文件中配置。以下是默认配置:
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缺省为无限制,您的问题可能是由缓冲区大小引起的。
https://stackoverflow.com/questions/30492842
复制相似问题