You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by Jonathan Knehr <jo...@gmail.com> on 2014/04/07 21:50:21 UTC

Session timeouts

Can someone explain the difference between minSessionTimeout and maxSessionTimeout?

The documentation is not very clear with regards to these.

For some background info, my zookeeper cluster is getting corrupted sessions when the system clock is changed by a PTP for a seconds, or there is a few second GC happening in one of the zk clients.

Thanks in advance!

Jonathan

Re: Session timeouts

Posted by Patrick Hunt <ph...@apache.org>.
Hi Jonathan, a session has a lifetime, it's defined by the session
timeout. When a client first establishes a session with the server it
negotiates a value. The client wants the value you provided when
creating the ZooKeeper object, the server will allow the client to
request any value as long as it's within the min and max session
timeouts (the params you listed initially). If maxSessionTimeout is
set to 40 and the client requests 20 it will get 20 (as long as 20 is
above the min of course). We print the negotiated value to the log,
it's helpful for debugging this.

Likely you want to set the ZooKeeper session timeout to a larger value
(and not the max session timeout as that wouldn't really help) if
you're facing GC "stop the world" issues. Granted there are
plusses/minuses to this.

Regards,

Patrick

On Mon, Apr 7, 2014 at 1:22 PM, Jonathan Knehr <jo...@gmail.com> wrote:
> Hi Raul,
>
> Thanks for the link. Unfortunately I cannot use a patch for this right now, I'm stuck with what I have. Just looking to make it less sensitive to few second GCs or clock syncs. My understanding is that these session configurations will help, but I am not exactly sure what they do to come up with appropriate settings for each of them.
>
> Regards,
> Jonathan
>
> Sent from my iPhone
>
> On Apr 7, 2014, at 4:16 PM, Raúl Gutiérrez Segalés <rg...@itevenworks.net> wrote:
>
>> Hi,
>>
>>
>> On 7 April 2014 12:50, Jonathan Knehr <jo...@gmail.com> wrote:
>>
>>>
>>> Can someone explain the difference between minSessionTimeout and
>>> maxSessionTimeout?
>> https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java#L403
>>
>>
>>> The documentation is not very clear with regards to these.
>>>
>>> For some background info, my zookeeper cluster is getting corrupted
>>> sessions when the system clock is changed by a PTP for a seconds, or there
>>> is a few second GC happening in one of the zk clients.
>> Perhaps: https://issues.apache.org/jira/browse/ZOOKEEPER-1366 (I haven't
>> tested that patch myself though).
>>
>>
>> -rgs

Re: Session timeouts

Posted by Jonathan Knehr <jo...@gmail.com>.
Hi Raul,

Thanks for the link. Unfortunately I cannot use a patch for this right now, I'm stuck with what I have. Just looking to make it less sensitive to few second GCs or clock syncs. My understanding is that these session configurations will help, but I am not exactly sure what they do to come up with appropriate settings for each of them.

Regards,
Jonathan

Sent from my iPhone

On Apr 7, 2014, at 4:16 PM, Raúl Gutiérrez Segalés <rg...@itevenworks.net> wrote:

> Hi,
> 
> 
> On 7 April 2014 12:50, Jonathan Knehr <jo...@gmail.com> wrote:
> 
>> 
>> Can someone explain the difference between minSessionTimeout and
>> maxSessionTimeout?
> https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java#L403
> 
> 
>> The documentation is not very clear with regards to these.
>> 
>> For some background info, my zookeeper cluster is getting corrupted
>> sessions when the system clock is changed by a PTP for a seconds, or there
>> is a few second GC happening in one of the zk clients.
> Perhaps: https://issues.apache.org/jira/browse/ZOOKEEPER-1366 (I haven't
> tested that patch myself though).
> 
> 
> -rgs

Re: Session timeouts

Posted by Raúl Gutiérrez Segalés <rg...@itevenworks.net>.
Hi,


On 7 April 2014 12:50, Jonathan Knehr <jo...@gmail.com> wrote:

>
> Can someone explain the difference between minSessionTimeout and
> maxSessionTimeout?
>
>
https://github.com/apache/zookeeper/blob/trunk/src/java/main/org/apache/zookeeper/server/quorum/QuorumPeer.java#L403


> The documentation is not very clear with regards to these.
>
> For some background info, my zookeeper cluster is getting corrupted
> sessions when the system clock is changed by a PTP for a seconds, or there
> is a few second GC happening in one of the zk clients.
>
>
Perhaps: https://issues.apache.org/jira/browse/ZOOKEEPER-1366 (I haven't
tested that patch myself though).


-rgs