james-server-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Charles <e...@apache.org>
Subject Re: Using connectionBacklog
Date Wed, 13 Feb 2013 06:25:34 GMT
Hi Philipp,

James creates the Netty ServerBootstrap [1] given the option 
connectionBacklog ( bootstrap.setOption("backlog", backlog);)

It also add to the Netty pipeline a ConnectionLimitUpstreamHandler [2] 
that controls with a map the simultaneous connections [2]

Does it makes sense?

Thx, Eric

[1] 
http://static.netty.io/3.6/api/org/jboss/netty/bootstrap/ServerBootstrap.html

[2] 
https://svn.apache.org/repos/asf/james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/ConnectionLimitUpstreamHandler.java

On 12/02/2013 16:12, Phillip Odam wrote:
> Hi Eric
>
> Thanks so much for the once again speedy reply.
>
> I must be missing something here. Are you saying the purpose of the
> backlog is not to control the maximum length of the queue of pending
> connections?
>
> I have never programmed with netty but having directly used the java
> class ServerSocket, my understanding of backlog is along the line of the
> Java runtime documentation/implementation. I had assumed based on the
> terminology around james and for that matter netty, that connection
> limit would refer to the maximum number of active connections allowed to
> the server. Whereas connection backlog is a holding place for pending
> connections when the connection limit is exceeded.
>
>  From what I've seen so far on netty and it's use I was of the
> understanding that their use of backlog was in line with mine.
>
> Thanks
> Phillip
>
> On 2/12/13 10:17 AM, Eric Charles wrote:
>> Hi Phillip,
>>
>> It is rejected because you set connectionLimit=1.
>>
>> connectionBacklog and connectionLimit are two different technical way to
>> achieve the same goal. That's not ideal, but allows to configure in
>> different ways.
>>
>> In you case, you will need to also set connectionLimit to 200.
>>
>> Thx, Eric
>>
>>
>> On 12/02/2013 15:11, Phillip Odam wrote:
>>> Thanks for the response Eric.
>>>
>>> I must admit I had thought the backlog count would not include the
>>> current connections. However when testing I also tried a greater number
>>> for backlog e.g.
>>>
>>> connectionBacklog = 200
>>> connectionLimit = 1
>>>
>>> And I'm still only able to make one connection and all subsequent
>>> connections are immediately rejected. Has anyone seen backlog working in
>>> james?
>>>
>>> Phillip
>>>
>>> On 2/12/13 1:46 AM, Eric Charles wrote:
>>>> Hi,
>>>>
>>>> If you set backlog=1, the socket can not queue more than one request at
>>>> a time. So if the socket is already busy with one connection, a second
>>>> connection request will be simply rejected. The backlog property is
>>>> given to netty for its bootstrap.
>>>>
>>>> The connectionLimit is implemented with Netty handlers which rejects
>>>> connection if you have already more open connection than the given
>>>> number.
>>>>
>>>> Thx, Eric
>>>>
>>>>
>>>> On 11/02/2013 16:47, Phillip Odam wrote:
>>>>> Can anyone confirm successful use of connectionBacklog for the smtp
>>>>> service on james 3.0 beta4 (or any v3). Successful use of
>>>>> connectionBacklog for any of the other services e.g. imap, lmtp and
>>>>> pop3
>>>>> is also of interest as under the covers the code is all common.
>>>>>
>>>>> Firstly I gather the connectionBacklog setting is controlling the
>>>>> backlog just as is done in
>>>>> http://docs.oracle.com/javase/6/docs/api/java/net/ServerSocket.html
>>>>>
>>>>> Secondly comparing the code
>>>>>   -
>>>>> http://svn.apache.org/repos/asf/james/protocols/trunk/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>   -
>>>>> http://svn.apache.org/repos/asf/james/protocols/tags/protocols-1.6.2/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> reports no differences so apart from the different versions of netty
>>>>> between beta4 and where beta5 development is there should be no
>>>>> difference with the backlog between beta4 and the current development
>>>>> stream.
>>>>>
>>>>>
>>>>> Changing the connectionBacklog value does cause the startup log entry
>>>>> (SMTP Service connection backlog is: XXX) to change accordingly,
>>>>> however...
>>>>>
>>>>> SETUP
>>>>> -----
>>>>>
>>>>> connectionBacklog = 1
>>>>> connectionLimit = 1
>>>>>
>>>>> TESTING
>>>>> -------
>>>>>
>>>>> With two command lines, use telnet to connect to the smtp service, the
>>>>> first telnet instance will establish a connection.
>>>>>
>>>>> The second instance reports back immediately that a connection can not
>>>>> be established, whereas I would expect the second instance to hang and
>>>>> either establish a connection when the first telnet instance
>>>>> disconnects
>>>>> or a timeout occurs.
>>>>>
>>>>>
>>>>> Testing thus far has not been in a controlled environment so the
>>>>> backlog
>>>>> issue may well not be with james, but before I go much further I
>>>>> wanted
>>>>> to see what anyone else out there is seeing.
>>>>>
>>>>> Thanks
>>>>> Phillip
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>>
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>>> For additional commands, e-mail: server-user-help@james.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
>> For additional commands, e-mail: server-user-help@james.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
> For additional commands, e-mail: server-user-help@james.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscribe@james.apache.org
For additional commands, e-mail: server-user-help@james.apache.org


Mime
View raw message