Skip to content

Options to set MaxIdleConns and MaxIdleConnsPerHost for outputs.http plugin #10953

@rkilingr

Description

@rkilingr

Feature Request

The default transport configuration for MaxIdleConns and MaxIdleConnsPerHost in golang is 100(No limits if it's set as zero in a custom defined RoundTripper or 100 if using DefaultTransport) and 2 respectively which may not be ideal for all production environments, especially the default value for MaxIdleConnsPerHost may lead to multiple TCP connections getting opened and closed. Currently these are not configurable for outputs.http plugin

Proposal:

Have values for MaxIdleConns & MaxIdleConnsPerHost be configurable in the outputs.http config.

  ## MaxIdleConns controls the maximum number of idle (keep-alive)
  ## connections across all hosts. Zero means no limit.
  # max_idle_conn = 0

  ## MaxIdleConnsPerHost, if non-zero, controls the maximum idle
  ## (keep-alive) connections to keep per-host. If zero,
  ## DefaultMaxIdleConnsPerHost is used(2).
  # max_idle_conn_per_host = 0

Current behavior:

Both MaxIdleConns & MaxIdleConnsPerHost are set as zero for http output plugin

Desired behavior:

Both MaxIdleConns & MaxIdleConnsPerHost configurable from the configuration file

Use case:

  • Production environments where multiple concurrent connections are made and the connections can be reused with keep-alive

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions