You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jmeter.apache.org by bu...@apache.org on 2019/05/06 12:37:23 UTC

[Bug 63406] New: new option for JDBC connection configuration: pre-initialize the connection pool

https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

            Bug ID: 63406
           Summary: new option for JDBC connection configuration:
                    pre-initialize the connection pool
           Product: JMeter
           Version: 5.1.1
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: issues@jmeter.apache.org
          Reporter: franz.schwab@exasol.com
  Target Milestone: JMETER_5.1.1

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:
https://github.com/frschwab/jmeter/commit/8dd8462f9349b990640f3e2290c84f23a715a7c5

Thanks for any feedback on this.
Best regards,
Franz

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] JDBC connection configuration: new option for pre-initialize to initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|JMETER_5.1.1                |JMETER_5.2
            Summary|new option for JDBC         |JDBC connection
                   |connection configuration:   |configuration: new option
                   |pre-initialize the          |for pre-initialize to
                   |connection pool             |initialize the connection
                   |                            |pool

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #7 from Franz Schwab <fr...@exasol.com> ---
pull request here: https://github.com/apache/jmeter/pull/477

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1
           Keywords|                            |PatchAvailable

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #1 from Franz Schwab <fr...@exasol.com> ---
current work status from my side:
https://github.com/frschwab/jmeter/commit/102f0ac58af82a28e01565047f3d114366996231
do you have any comments? Otherwise I am asking for a pull request in the next
days.
I would be happy to get some feedback!

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #3 from Franz Schwab <fr...@exasol.com> ---
Thanks for the comment, here my reply:
https://github.com/frschwab/jmeter/commit/102f0ac58af82a28e01565047f3d114366996231#commitcomment-33533415
Best regards,
Franz

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #5 from Franz Schwab <fr...@exasol.com> ---
Hi Philippe,

I assume some tests would be necessary before submitting a pr request?
I didn't find the time yet to do so.

Best,
Franz

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #4 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Hello Franz,
Do you plan to submit a PR ?

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

--- Comment #6 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Franz Schwab from comment #5)
> Hi Philippe,
> 
> I assume some tests would be necessary before submitting a pr request?
> I didn't find the time yet to do so.
> 
> Best,
> Franz

Hi Franz, yes we prefer a Junit clearly.
But you could submit a PR and then commit a JUnit test.
This way you can start getting feedback.

Please note we have migrated now to Git directly , so you may need to either
reclone it or follow this procedure:

- https://github.com/vlsi/jmeter-git-cleanup/tree/v2.2.0/clean_fork

Thanks

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] new option for JDBC connection configuration: pre-initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
                 CC|                            |p.mouawad@ubik-ingenierie.c
                   |                            |om

--- Comment #2 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
(In reply to Franz Schwab from comment #1)
> current work status from my side:
> https://github.com/frschwab/jmeter/commit/
> 102f0ac58af82a28e01565047f3d114366996231
> do you have any comments? Otherwise I am asking for a pull request in the
> next days.
> I would be happy to get some feedback!

Hello,
First thanks for contributing,  it's great !

I have looked at PR and left one comment .

Regards

-- 
You are receiving this mail because:
You are the assignee for the bug.

[Bug 63406] JDBC connection configuration: new option for pre-initialize to initialize the connection pool

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63406

Philippe Mouawad <p....@ubik-ingenierie.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEEDINFO                    |RESOLVED
           Keywords|                            |FixedInTrunk

--- Comment #8 from Philippe Mouawad <p....@ubik-ingenierie.com> ---
Fixed within commit:

-
https://github.com/apache/jmeter/commit/031807aed3d8365513b9e0689ce599bc5d97ddc1

-- 
You are receiving this mail because:
You are the assignee for the bug.