Skip to content

Commit

Permalink
Make akka max-frame-size configurable
Browse files Browse the repository at this point in the history
Also, make it actually do something. We currently specify it in a
non-functioning way for the version of akka we're using. Apparently the
key for that piece of configuration changed with the versions.

128K is the default for Akka, which is how it's been de facto configured
since the last release. Changing the default to 1024K, which is a little
more real-world useful for applications using Sirius, particularly WRT
catchup messages.

Also, make send/receive buffers scale with max-message-size.
  • Loading branch information
clinedome-work committed May 2, 2014
1 parent bee45ef commit d64c17e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/main/resources/sirius-akka-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ common-netty-settings {
hostname = ""
port = 2552

# band-aid while our messages are too big :)
message-frame-size = 100 MiB

# this is probably too liberal
connection-timeout = 2s

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ object SiriusConfiguration {
* Congestion Avoidance. Default is 500.
*/
final val CATCHUP_DEFAULT_SSTHRESH = "sirius.catchup.default-ssthresh"

/*
* Maximum akka message size in KB. Default is 1024.
*/
final val MAX_AKKA_MESSAGE_SIZE_KB = "sirius.akka.maximum-frame-size-kb"
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ import com.comcast.xfinity.sirius.api.SiriusConfiguration
import com.comcast.xfinity.sirius.info.SiriusInfo
import com.comcast.xfinity.sirius.writeaheadlog.CachedSiriusLog
import com.comcast.xfinity.sirius.writeaheadlog.SiriusLog
import com.typesafe.config.Config
import com.typesafe.config.ConfigFactory
import com.typesafe.config.{Config, ConfigFactory}

import akka.actor.ActorRef
import akka.actor.ActorSystem
Expand Down Expand Up @@ -159,6 +158,12 @@ object SiriusFactory {
siriusConfig.getProp(SiriusConfiguration.HOST, InetAddress.getLocalHost.getHostName))
configMap.put(s"$transportPrefix.port", siriusConfig.getProp(SiriusConfiguration.PORT, 2552))

val maxMessageSize = siriusConfig.getProp(SiriusConfiguration.MAX_AKKA_MESSAGE_SIZE_KB, "1024")
val bufferSize = maxMessageSize * 2
configMap.put(s"$transportPrefix.maximum-frame-size", s"${maxMessageSize}k")
configMap.put(s"$transportPrefix.send-buffer-size", s"${bufferSize}k")
configMap.put(s"$transportPrefix.receive-buffer-size", s"${bufferSize}k")

if (sslEnabled) {
configMap.put(s"$transportPrefix.random-number-generator",
siriusConfig.getProp(SiriusConfiguration.SSL_RANDOM_NUMBER_GENERATOR, ""))
Expand Down
3 changes: 0 additions & 3 deletions src/test/resources/sirius-akka-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ common-netty-settings {
hostname = ""
port = 2552

# band-aid while our messages are too big :)
message-frame-size = 100 MiB

# this is probably too liberal
connection-timeout = 2s

Expand Down

0 comments on commit d64c17e

Please sign in to comment.