You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by jelmerterwal <gi...@git.apache.org> on 2017/04/24 10:25:08 UTC

[GitHub] tomcat pull request #54: Respect minimum pool size

GitHub user jelmerterwal opened a pull request:

    https://github.com/apache/tomcat/pull/54

    Respect minimum pool size

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jelmerterwal/tomcat respec_min_pool_size

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/tomcat/pull/54.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #54
    
----
commit 41e5f29530ff241d82f954911e48cb0af7bbdff6
Author: Jelmer ter Wal <je...@nedap.com>
Date:   2017-04-24T10:17:38Z

    Respect minimum pool size

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] tomcat issue #54: Respect minimum pool size

Posted by jelmerterwal <gi...@git.apache.org>.
Github user jelmerterwal commented on the issue:

    https://github.com/apache/tomcat/pull/54
  
    Below an image of further progress during the day. Where graphs peek at 40 the application has been restarted.
    
    <img width="793" alt="screen shot 2017-04-24 at 18 48 00" src="https://cloud.githubusercontent.com/assets/5363087/25348472/af5048f0-291e-11e7-9c5c-ee9c4ffc7a87.png">



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] tomcat issue #54: Respect minimum pool size

Posted by jelmerterwal <gi...@git.apache.org>.
Github user jelmerterwal commented on the issue:

    https://github.com/apache/tomcat/pull/54
  
    For an application I develop, I see a drop in connections. The screenshot show different values of the connection pool.
    
    Legend for the colours;
    - grey -> pool size
    - greenish -> idle connections
    - orange/red -> connections in use
    - purple -> waiting for a connection
    
    ![screen shot 2017-04-24 at 13 49 43](https://cloud.githubusercontent.com/assets/5363087/25335835/07a5554c-28f5-11e7-97f4-d877f1181e50.png)
    
    The application uses dropwizard (www.dropwizard.io) which internally uses Tomcat's JDBC Pool. The application has 4 instances. The graph shows the sum of these instances for the number of connections.
    
    - min size of idle connection is set to 10 (so should be 10 x 4 = 40)
    - the decrease happens due abandoning of connections
    
    The documentation indicates a minimum pool of idle connections should be available. It scared me when I first saw this happening.
    
    ```
    minIdle
    
    (int) The minimum number of established connections that should be kept in the pool at all times. The connection pool can shrink below this number if validation queries fail. Default value is derived from initialSize:10 (also see testWhileIdle)
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] tomcat pull request #54: Respect minimum pool size [#61032]

Posted by sakalaramesh <gi...@git.apache.org>.
Github user sakalaramesh commented on a diff in the pull request:

    https://github.com/apache/tomcat/pull/54#discussion_r216162039
  
    --- Diff: modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/ConnectionPool.java ---
    @@ -622,6 +622,11 @@ protected void release(PooledConnection con) {
             // notified
             if (waitcount.get() > 0) {
                 idle.offer(create(true));
    +
    +        // we also want to respect the minimum number of idle connections
    +        // (if the connection pool is closing do not create new connections!)
    +        } else if (idle.size() + busy.size() < getPoolProperties().getMinIdle() && !isClosed()) {
    +            idle.offer(create(true));
    --- End diff --
    
    filling idle queue I think should be part of the PoolCleaner instead of being part of the release(), especially if poolSweeper is enabled. release() is invoked while application request is waiting most of the time. 
    
    Also, minIdle is for number of idle connections, not the total of idle+busy connections. Shouldn't we be filling idle queue when idle queue size falls below minIdle independent of busy queue size?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[GitHub] tomcat issue #54: Respect minimum pool size [#61032]

Posted by jelmerterwal <gi...@git.apache.org>.
Github user jelmerterwal commented on the issue:

    https://github.com/apache/tomcat/pull/54
  
    @markt-asf could you have a look at this PR?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org