简体   繁体   中英

How to enable HTTP Pipelining with Spray-Can

I read on the spray-can docs that it supports HTTP Pipelining. But there is no method or example specified anywhere on how to do it.

This is a config setting. See this or this doc for all available settings in Spay config.

This setting turns it on:

spray.can.host-connector.pipelining = off

And this one has to be > 1 to effectively enable it:

spray.can.server.pipelining-limit = 1

By default pipelining is off.

Relevant description of each setting:

 # 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" (ie 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 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM