You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Nitish Chitta <ni...@cloud.com.INVALID> on 2025/09/12 11:33:05 UTC
Re: Tomcat maxConnections API
Just another query here!
Please let me know if the maxQueueSize attribute will be of any help to
tackle this case.
Regards,
Nitish
On Fri, Sep 12, 2025 at 4:59 PM Nitish Chitta <ni...@cloud.com>
wrote:
> Just another query here!
> Please let me know if the maxQueueSize attribute will be of any help to
> tackle this case.
>
> Regards,
> Nitish
>
> On Thu, Jul 31, 2025 at 8:48 AM Nitish Chitta <ni...@cloud.com>
> wrote:
>
>> Thats right, Chris!
>>
>> Tried that and also multiple ways of enforcing the setting on the Kernel
>> level. Nothing helps!
>>
>> Regards,
>> Nitish
>>
>>
>> On Thu, 31 Jul 2025 at 03:59, Christopher Schultz <
>> chris@christopherschultz.net> wrote:
>>
>>> Nitish,
>>>
>>> On 7/30/25 10:03 AM, Nitish Chitta wrote:
>>> > Any suggestions from your side for Linux? Tried out multiple
>>> approaches but
>>> > none seem to work.
>>>
>>> The best you can do is set maxConnections to the number you want at the
>>> maximum and set acceptCount=0, but even then the OS may accept more
>>> connections.
>>>
>>> -chris
>>>
>>> > On Wed, 30 Jul 2025 at 13:49, Mark Thomas <ma...@apache.org> wrote:
>>> >
>>> >> On 30/07/2025 08:53, Nitish Chitta wrote:
>>> >>> Hello,
>>> >>> I want to enforce rejection of connections after the *maxConnections
>>> +
>>> >>> acceptCount *has been reached. This seems to be working fine with
>>> Windows
>>> >>> but, on Linux the limit is not getting applied and we do not see the
>>> >>> requests getting rejected.
>>> >>>
>>> >>> I am using embedded Tomcat 9 with Http11NioProtocol.
>>> >>>
>>> >>> Please advise.
>>> >>
>>> >> As per the docs for acceptCount:
>>> >>
>>> >> "The operating system may ignore this setting and use a different size
>>> >> for the queue."
>>> >>
>>> >> You'll need to look at the docs for your OS.
>>> >>
>>> >> Mark
>>> >>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> >> For additional commands, e-mail: users-help@tomcat.apache.org
>>> >>
>>> >>
>>> >
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
Re: Tomcat maxConnections API
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Nitish,
On 9/12/25 7:33 AM, Nitish Chitta wrote:
> Please let me know if the maxQueueSize attribute will be of any help to
> tackle this case.
The default for that is Integer.MAX_VALUE which is ... high. I assume
you are considering reducing that?
I've actually never played around with that setting, so I don't know. If
you set that to 10 and then make 11 concurrent connections, I'm not sure
if the 11th connection will be refused. Since you can make more than one
request over a single connection, I suspect that the number of
connections versus the number of "runnable tasks that can queue" doesn't
match, and you may find that some accepted connections will have
requests rejected which might be surprising.
I would test in your own environment to see what the behavior is. But
have a GOOD test to make sure you are answering the question you think
you are asking.
What problem are you really trying to solve? From your questions, it
sounds like you have a capacity problem that you should be solving by
... adding more capacity instead of trying to configure your way around it.
-chris
> On Fri, Sep 12, 2025 at 4:59 PM Nitish Chitta <ni...@cloud.com>
> wrote:
>
>> Just another query here!
>> Please let me know if the maxQueueSize attribute will be of any help to
>> tackle this case.
>>
>> Regards,
>> Nitish
>>
>> On Thu, Jul 31, 2025 at 8:48 AM Nitish Chitta <ni...@cloud.com>
>> wrote:
>>
>>> Thats right, Chris!
>>>
>>> Tried that and also multiple ways of enforcing the setting on the Kernel
>>> level. Nothing helps!
>>>
>>> Regards,
>>> Nitish
>>>
>>>
>>> On Thu, 31 Jul 2025 at 03:59, Christopher Schultz <
>>> chris@christopherschultz.net> wrote:
>>>
>>>> Nitish,
>>>>
>>>> On 7/30/25 10:03 AM, Nitish Chitta wrote:
>>>>> Any suggestions from your side for Linux? Tried out multiple
>>>> approaches but
>>>>> none seem to work.
>>>>
>>>> The best you can do is set maxConnections to the number you want at the
>>>> maximum and set acceptCount=0, but even then the OS may accept more
>>>> connections.
>>>>
>>>> -chris
>>>>
>>>>> On Wed, 30 Jul 2025 at 13:49, Mark Thomas <ma...@apache.org> wrote:
>>>>>
>>>>>> On 30/07/2025 08:53, Nitish Chitta wrote:
>>>>>>> Hello,
>>>>>>> I want to enforce rejection of connections after the *maxConnections
>>>> +
>>>>>>> acceptCount *has been reached. This seems to be working fine with
>>>> Windows
>>>>>>> but, on Linux the limit is not getting applied and we do not see the
>>>>>>> requests getting rejected.
>>>>>>>
>>>>>>> I am using embedded Tomcat 9 with Http11NioProtocol.
>>>>>>>
>>>>>>> Please advise.
>>>>>>
>>>>>> As per the docs for acceptCount:
>>>>>>
>>>>>> "The operating system may ignore this setting and use a different size
>>>>>> for the queue."
>>>>>>
>>>>>> You'll need to look at the docs for your OS.
>>>>>>
>>>>>> Mark
>>>>>>
>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>> For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org