我在spray-can文档上读到它支持 HTTP Pipelining。但是没有在任何地方指定如何做到这一点的方法或示例。
问问题
706 次
1 回答
1
这是一个配置设置。有关 Spay 配置中所有可用设置的信息,请参阅此文档或此文档。
此设置将其打开:
spray.can.host-connector.pipelining = off
这个必须大于 1 才能有效地启用它:
spray.can.server.pipelining-limit = 1
默认情况下,流水线是关闭的。
各项设置的相关说明:
# 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. # Set to 'disabled' for completely disabling pipelining limits # (not recommended on public-facing servers due to risk of DoS attacks). # This value must be > 0 and <= 128. pipelining-limit = 1 # If this setting is enabled, the `HttpHostConnector` pipelines requests # across connections, otherwise only one single request can be "open" # on a particular HTTP connection. pipelining = off
于 2015-12-10T02:49:38.380 回答