+htc migrate pipelining-limit server config setting from spray
This commit is contained in:
parent
b385c6c6e3
commit
89425d03a7
3 changed files with 16 additions and 1 deletions
|
|
@ -29,6 +29,18 @@ akka.http {
|
|||
# deliver an unlimited backpressured stream of incoming connections.
|
||||
max-connections = 1024
|
||||
|
||||
# The maximum number of requests that are accepted (and dispatched to
|
||||
# the application) on one single connection before the first request
|
||||
# has to be completed.
|
||||
# Incoming requests that would cause the pipelining limit to be exceeded
|
||||
# are not read from the connections socket so as to build up "back-pressure"
|
||||
# to the client via TCP flow control.
|
||||
# A setting of 1 disables HTTP pipelining, since only one request per
|
||||
# connection can be "open" (i.e. being processed by the application) at any
|
||||
# time. Set to higher values to enable HTTP pipelining.
|
||||
# This value must be > 0 and <= 1024.
|
||||
pipelining-limit = 16
|
||||
|
||||
# Enables/disables the addition of a `Remote-Address` header
|
||||
# holding the clients (remote) IP address.
|
||||
remote-address-header = off
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ final case class ServerSettings(
|
|||
serverHeader: Option[Server],
|
||||
timeouts: ServerSettings.Timeouts,
|
||||
maxConnections: Int,
|
||||
pipeliningLimit: Int,
|
||||
remoteAddressHeader: Boolean,
|
||||
rawRequestUriHeader: Boolean,
|
||||
transparentHeadRequests: Boolean,
|
||||
|
|
@ -38,6 +39,7 @@ final case class ServerSettings(
|
|||
parserSettings: ParserSettings) {
|
||||
|
||||
require(0 < maxConnections, "max-connections must be > 0")
|
||||
require(0 < pipeliningLimit && pipeliningLimit <= 1024, "pipelining-limit must be > 0 and <= 1024")
|
||||
require(0 < responseHeaderSizeHint, "response-size-hint must be > 0")
|
||||
require(0 < backlog, "backlog must be > 0")
|
||||
}
|
||||
|
|
@ -55,6 +57,7 @@ object ServerSettings extends SettingsCompanion[ServerSettings]("akka.http.serve
|
|||
c getPotentiallyInfiniteDuration "idle-timeout",
|
||||
c getFiniteDuration "bind-timeout"),
|
||||
c getInt "max-connections",
|
||||
c getInt "pipelining-limit",
|
||||
c getBoolean "remote-address-header",
|
||||
c getBoolean "raw-request-uri-header",
|
||||
c getBoolean "transparent-head-requests",
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ private[http] object HttpServerBluePrint {
|
|||
csRequestPrepOut ~> requestPrep
|
||||
|
||||
// One2OneBidi
|
||||
val one2one = b.add(new One2OneBidi[HttpRequest, HttpResponse](16)) // TODO: replace hard-coded value by reintroducing `pipeline-limit` setting from spray
|
||||
val one2one = b.add(new One2OneBidi[HttpRequest, HttpResponse](settings.pipeliningLimit))
|
||||
requestPrep.outlet ~> one2one.in1
|
||||
one2one.out2 ~> csHttpResponseIn
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue