Skip to content

feat(inputs.sqlserver): Set pool size and idle connection - #17796

Merged
skartikey merged 8 commits into
influxdata:masterfrom
meorkamil:feat/adding-pool-connection-inputs-sqlserver
Oct 20, 2025
Merged

feat(inputs.sqlserver): Set pool size and idle connection#17796
skartikey merged 8 commits into
influxdata:masterfrom
meorkamil:feat/adding-pool-connection-inputs-sqlserver

Conversation

@meorkamil

Copy link
Copy Markdown
Contributor

Summary

[[inputs.sqlserver]] do not support connection pooling. Hence it created multiple connection to the database. This PR is to add the connection pool.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #17781

@telegraf-tiger telegraf-tiger Bot added area/sqlserver feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins labels Oct 10, 2025

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PR @meorkamil! A few comments from my side.

Comment thread plugins/inputs/sqlserver/sqlserver.go Outdated
Comment thread plugins/inputs/sqlserver/sample.conf Outdated
Comment thread plugins/inputs/sqlserver/sqlserver.go Outdated
Comment thread plugins/inputs/sqlserver/sqlserver.go Outdated
@srebhan srebhan self-assigned this Oct 10, 2025

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @meorkamil for the update! Some more comments...

Comment thread plugins/inputs/sqlserver/sqlserver.go
Comment thread plugins/inputs/sqlserver/sqlserver.go
Comment thread plugins/inputs/sqlserver/sample.conf Outdated
Comment on lines +133 to +136
## Connection pool configuration.
## Set the maximum number of open connections to the database.
## Default is 0 (unlimited)
# max_open_connections = 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please be brief. You don't need to mention the default as this is in the commented option...

Suggested change
## Connection pool configuration.
## Set the maximum number of open connections to the database.
## Default is 0 (unlimited)
# max_open_connections = 0
## Maximum number of open connections to the database, 0 allows the driver to decide
# max_open_connections = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Comment thread plugins/inputs/sqlserver/sample.conf Outdated
Comment on lines +138 to +140
## Set the maximum number of connections in the idle connection pool.
## Default is 2
# max_idle_connections = 2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Set the maximum number of connections in the idle connection pool.
## Default is 2
# max_idle_connections = 2
## Maximum number of idle connections in the connection pool, 0 allows the driver to decide
# max_idle_connections = 0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to max_open_connections, Noted.

@meorkamil
meorkamil force-pushed the feat/adding-pool-connection-inputs-sqlserver branch from 0f5c408 to c081819 Compare October 17, 2025 01:11
@telegraf-tiger

Copy link
Copy Markdown
Contributor

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. Thanks @meorkamil!

@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Oct 20, 2025
@srebhan srebhan assigned skartikey and mstrandboge and unassigned srebhan Oct 20, 2025

@skartikey skartikey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meorkamil Thanks for the contribution!

@skartikey
skartikey merged commit dc40e05 into influxdata:master Oct 20, 2025
26 of 27 checks passed
@github-actions github-actions Bot added this to the v1.37.0 milestone Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sqlserver feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

4 participants