[ 
https://issues.apache.org/jira/browse/HDFS-14114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16703486#comment-16703486
 ] 

Íñigo Goiri commented on HDFS-14114:
------------------------------------

I think having this configurable is fair.
A couple comments:
* Avoid the new lines added.
* We should have an actual unit test that checks that the ratio kicks in; I 
think we already have some wiring you can leverage in {{TestConnectionManager}} 
or so.

[~crh] had also some internal improvements on the connection manager.
We will eventually improve this part of the code in general.

> RBF:MIN_ACTIVE_RATIO should be configurable
> -------------------------------------------
>
>                 Key: HDFS-14114
>                 URL: https://issues.apache.org/jira/browse/HDFS-14114
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Fei Hui
>            Assignee: Fei Hui
>            Priority: Major
>         Attachments: HDFS-14114.001.patch, HDFS-14114.002.patch
>
>
> The following code contains 
> {code:java}
>       if (timeSinceLastActive > connectionCleanupPeriodMs ||
>           active < MIN_ACTIVE_RATIO * total) {
>         // Remove and close 1 connection
>         List<ConnectionContext> conns = pool.removeConnections(1);
>         for (ConnectionContext conn : conns) {
>           conn.close();
>         }
>         LOG.debug("Removed connection {} used {} seconds ago. " +
>                 "Pool has {}/{} connections", pool.getConnectionPoolId(),
>             TimeUnit.MILLISECONDS.toSeconds(timeSinceLastActive),
>             pool.getNumConnections(), pool.getMaxSize());
>       }
> ...
>             if (pool.getNumConnections() < pool.getMaxSize() &&
>                 active >= MIN_ACTIVE_RATIO * total) {
>               ConnectionContext conn = pool.newConnection();
>               pool.addConnection(conn);
>             } else {
>               LOG.debug("Cannot add more than {} connections to {}",
>                   pool.getMaxSize(), pool);
>             }
> {code}
> It affects cleanup and creating Connections. Maybe it should be configurable 
> so that we can reconfig it to improve performance



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to