В настоящее время мы переносим приложение tomcat на приложение spray/scala.
Наше старое приложение имеет такую настройку:
<Connector port="8082" protocol="HTTP/1.1"
maxThreads="1000"
maxConnections="10000"
processorCache="500"
connectionTimeout="20000"
URIEncoding="UTF-8"
redirectPort="8443" />
В нашем новом приложении мы хотели бы установить эквивалент maxThreads/maxConnections в spray.
Я видел файл reference.conf спрея (ниже) и мне интересно, действительно ли это правильные настройки для изменения?
Или мне лучше настроить актера, который выполняет runRoute?
Или и то, и другое?
Я нашел низкое «max-connections = 4» по умолчанию немного странным, если это действительно ограничение на количество подключений к серверу.
host-connector {
# The maximum number of parallel connections that an `HttpHostConnector`
# is allowed to establish to a host. Must be greater than zero.
max-connections = 4
# The maximum number of times an `HttpHostConnector` attempts to repeat
# failed requests (if the request can be safely retried) before
# giving up and returning an error.
max-retries = 5
# Configures redirection following.
# If set to zero redirection responses will not be followed, i.e. they'll be returned to the user as is.
# If set to a value > zero redirection responses will be followed up to the given number of times.
# If the redirection chain is longer than the configured value the first redirection response that is
# is not followed anymore is returned to the user as is.
max-redirects = 0
# 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 time after which an idle `HttpHostConnector` (without open
# connections) will automatically terminate itself.
# Set to `infinite` to completely disable idle timeouts.
idle-timeout = 30 s
# Modify to tweak client settings for this host-connector only.
client = ${spray.can.client}
}