0

I am using Akka-Cluster and sending large objects over network using Akka IO through Tcp. The data is being cut down into very small chunks. The size of the data ByteString received through 'Received' message is very small (around 7KB). Is there any configuration setting using which I can send and receive larger ByteStrings at a time?

1 Answers1

1

The size of the received ByteString is configurable in the application.conf file. Here is the default configuration:

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
}

Try to change these settings. Since max-received-message-size defaults to unlimited, your problems might be caused by the buffer size.

Quizzie
  • 879
  • 4
  • 15