-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
JDBC connection configuration: new option for pre-initialize to initialize the connection pool #5059
Comments
Franz Schwab (migrated from Bugzilla): |
@pmouawad (migrated from Bugzilla):
Hello, I have looked at PR and left one comment . Regards |
Franz Schwab (migrated from Bugzilla): |
@pmouawad (migrated from Bugzilla): Thanks |
Franz Schwab (migrated from Bugzilla): I assume some tests would be necessary before submitting a pr request? Best, |
@pmouawad (migrated from Bugzilla):
Hi Franz, yes we prefer a Junit clearly. Please note we have migrated now to Git directly , so you may need to either reclone it or follow this procedure: Thanks |
Franz Schwab (migrated from Bugzilla): |
@pmouawad (migrated from Bugzilla): |
Franz Schwab (Bug 63406):
Hello JMeter developers,
I would like to suggest an enhancement to the JDBC connection configuration:
An option (true/false) where you can choose to pre-initialize the JDBC connection pool.
The default option should be "false", in order to not break existing behavior.
Currently, you get longer execution times for the first JDBC request for each thread of a thread group,
because the JDBC pool is only initialized when the first JDBC request asks the JDBC connection pool for a connection to execute its sql query.
Initialization currently also means: initializing the whole pool - before any JDBC request sampler is given a connection.
That means that each JDBC request, that is started before the connection pool is fully initialized, is affected by measuring connection establishment times for each of the following KPIs:
Elapsed time, latency, connect time.
There would also be an argument for setting the default option to be "true" and break existing behavior - as it doesn't make sense to measure "connect time" for example:
Because "connect time" for the first query doesn't mean "connection establishment time for one connection" - it currently means "connection establishment time for the whole pool".
The bigger the pool, the bigger the effect.
I know there are workarounds for this (e.g. a setup thread group). But then you have the sampler times even of that setup thread group in your result.jtl file.
I know there is an option to use a JSR223 post processor, sending some Groovy code like "prev.setIgnore()". But this is not very user friendly.
Here is what I found regarding the connection pooling library:
https://commons.apache.org/proper/commons-dbcp/apidocs/org/apache/commons/dbcp2/BasicDataSource.html#setInitialSize-int-
it says: "The pool is initialized the first time one of the following methods is invoked: getConnection, setLogwriter, setLoginTimeout, getLoginTimeout, getLogWriter."
https://commons.apache.org/proper/commons-dbcp/apidocs/org/apache/commons/dbcp2/BasicDataSource.html#getLogWriter--
it says: "Calls createDataSource(), so has the side effect of initializing the connection pool."
Using the side effect in our favour, here is my suggested change (currently hardcoded) - I need to add in in the GUI as an option of course - before asking for a git pull request:
frschwab@8dd8462
Thanks for any feedback on this.
Best regards,
Franz
OS: All
The text was updated successfully, but these errors were encountered: