Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rkilingr opened this issue Apr 10, 2022 · 0 comments · Fixed by #10954
Closed

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

rkilingr opened this issue Apr 10, 2022 · 0 comments · Fixed by #10954
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@rkilingr
Copy link
Contributor

rkilingr commented Apr 10, 2022

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
@rkilingr rkilingr added the feature request Requests for new plugin and for new features to existing plugins label Apr 10, 2022
rkilingr added a commit to rkilingr/telegraf that referenced this issue Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant