zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patrick Hunt <ph...@apache.org>
Subject Re: Session timeouts
Date Wed, 09 Apr 2014 05:24:11 GMT
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.



On Mon, Apr 7, 2014 at 1:22 PM, Jonathan Knehr <jonathan.knehr@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 <rgs@itevenworks.net> wrote:
>> Hi,
>> On 7 April 2014 12:50, Jonathan Knehr <jonathan.knehr@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

View raw message