Skip to content

New option “max_total_connections” for http.client #917

@Totktonada

Description

@Totktonada

API Changes:

It’s also better to mention how to interpret this options in order to avoid possible problems such as in here.
First of all defaults should be usually enough. It is rare when you might need to tune this options. So, when in doubt go with defaults.

Here are some tips about using these options:

  1. You may want to control maximum number of sockets using by a particular http client at the same time. For example, your system is doing lots of requests to distinct hosts (so curl cannot reuse sockets) and this requests take too much time to perform. In this case setting "max_total_connections" may be useful, which tells curl to hold all requests from creating a new socket if that number is reached.

  2. If you are going to set these options, you should avoid setting "max_connections" less then "max_total_connections" unless you are confident about your actions. When "max_connections" option is less then "max_total_connections" in some cases curl will not reuse sockets if requests is going to the same hosts. If the limit is reached, curl will first create a new socket, send a request, then wait for the first connection to free and close it in order to maintain max_connections cache size. In worst case scenario it will result in new socket creation on every request, even if all requests are going to the same host. See this issue for details.

Requested by @RunsFor in tarantool/tarantool#3945

It seems @TarantoolBot missed this request.

Metadata

Metadata

Assignees

Labels

featureA new functionalityreference[location] Tarantool manual, Reference partserver[area] Task relates to Tarantool's server (core) functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions