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

Reuse connections from connection pool in sqlserver input #5898

Closed
danielnelson opened this issue May 22, 2019 · 2 comments · Fixed by #8596
Closed

Reuse connections from connection pool in sqlserver input #5898

danielnelson opened this issue May 22, 2019 · 2 comments · Fixed by #8596
Labels
area/sqlserver feature request Requests for new plugin and for new features to existing plugins

Comments

@danielnelson
Copy link
Contributor

Feature Request

Proposal:

The sqlserver input should reuse connections from the connection pool.

Current behavior:

New connection pool is created every interval.

Desired behavior:

Hang on to the connection pool and reuse.

Use case:

Should be a lighter resource load on Telegraf and the server.

See also #3485 (comment)

@danielnelson danielnelson added feature request Requests for new plugin and for new features to existing plugins area/sqlserver labels May 22, 2019
@nwneisen
Copy link
Contributor

nwneisen commented Nov 24, 2019

I would like to take a look at making this change.

From what I can tell from looking at the PostgresSql plugin, the initialization and stop code for SqlServer should be moved into a Service. The service plugin will setup the connection pool to be used by the regular input plugin. When telegraf is terminated, the service plugin will be responsible for cleaning up the connection pool. This should also cleanup the structure of the SqlServer plugin as it currently has a number of checks to make sure everything is initialized.

I think I've got everything I need to start on this but wanted to lay out the plan in case someone sees something I'm missing.

@mjiderhamn
Copy link
Contributor

New connection pool is created every interval.

AFAI can tell, a new pool is even created for every query at every interval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sqlserver feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
3 participants