You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2020/10/29 14:42:45 UTC

[GitHub] [tomcat] anilgursel commented on pull request #371: NIO2: Call `accept` immediately if connection count is not close to max con…

anilgursel commented on pull request #371:
URL: https://github.com/apache/tomcat/pull/371#issuecomment-718799285


   I updated the PR to have it as `getMaxConnections() / 2`.  I agree it is just a heuristic and not clean.  We can potentially make it configurable?
   
   If my understanding is correct, one reason to schedule the `accept` is to prevent blocking the thread.  The reason behind blocking (via `LimitLatch`) is to have a hard limit on the `maxConnections`.  Is there any possibility to relax this a bit?  Something like:
   
   ```java
   else if (getConnectionCount() < getMaxConnections()) {
       increment();
       serverSock.accept(null, this);
   }
   
   ```
   
   With this, there is possibility of number of connections to go over `maxConnections` little bit (which I think the expectation can be managed in documentation).  Actually, I believe there will only be one thread doing `accept` logic at any given time.  Because, a new `accept` is scheduled only when the previous one is `completed`.   Is this true?  If so,  it would not go beyond maxConnections.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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