Session timeout and heartbeat interval

2016-02-08 Thread Jens Rantil
Hi,

I am trying to wrap my head around the difference between "
session.timeout.ms" and "heartbeat.interval.ms". Clearly they are somewhat
tied to the same logic since heartbeat value should be less than 1/3 of the
session timeout.

Let me add some specific questions:

   - Will a session be considered "dead" if it hasn't received a heartbeat
   within "session.timeout.ms"? In that case giving 2*heartbeat as slack
   for missed heartbeats seem like a LOT of slack. Given the default values, a
   client will have 27 seconds(!) to be able to send a second heartbeat.
   - Why can't session timeout simply be based on heartbeat interval?

Could anyone clarify this a bit? Also, if you are writing a new consumer,
what is your reasoning when setting these two value?

Thanks,
Jens


-- 
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook  Linkedin

 Twitter 


Re: Session timeout and heartbeat interval

2016-02-08 Thread Jens Rantil
Hi again,

A somewhat related question is also how the heartbeat interval and session
timeout relates to the poll timeout. Must the poll timeout always be lower
than the heartbeat interval?

Cheers,
Jens

On Monday, February 8, 2016, Jens Rantil  wrote:

> Hi,
>
> I am trying to wrap my head around the difference between "
> session.timeout.ms" and "heartbeat.interval.ms". Clearly they are
> somewhat tied to the same logic since heartbeat value should be less than
> 1/3 of the session timeout.
>
> Let me add some specific questions:
>
>- Will a session be considered "dead" if it hasn't received a
>heartbeat within "session.timeout.ms"? In that case giving 2*heartbeat
>as slack for missed heartbeats seem like a LOT of slack. Given the default
>values, a client will have 27 seconds(!) to be able to send a second
>heartbeat.
>- Why can't session timeout simply be based on heartbeat interval?
>
> Could anyone clarify this a bit? Also, if you are writing a new consumer,
> what is your reasoning when setting these two value?
>
> Thanks,
> Jens
>
>
> --
> Jens Rantil
> Backend engineer
> Tink AB
>
> Email: jens.ran...@tink.se
> 
> Phone: +46 708 84 18 32
> Web: www.tink.se
>
> Facebook  Linkedin
> 
>  Twitter 
>
>

-- 
Jens Rantil
Backend engineer
Tink AB

Email: jens.ran...@tink.se
Phone: +46 708 84 18 32
Web: www.tink.se

Facebook  Linkedin

 Twitter 


Re: Session timeout and heartbeat interval

2016-02-08 Thread Jason Gustafson
Hey Jens,

The heartbeat response is used by the coordinator to tell group members
that the group needs to rebalance. For example, if a new member joins the
consumer group, then the coordinator will wait for the heartbeat from each
member and set a REBALANCE_NEEDED error code in the response. Hence the
approximate time to rebalance depends on the heartbeat interval. This is
why we have set it fairly low by default. We actually had the interval
based on the session timeout initially (we set it to 1/3 of the session
timeout), but during development, it seemed like a good idea to give users
more control over the rebalance overhead by controlling the heartbeat
interval. For example, if you need to set the session timeout to 120
seconds, you might not be too thrilled to have your best-case rebalance
time of about 40 seconds.

-Jason

On Mon, Feb 8, 2016 at 7:49 AM, Jens Rantil  wrote:

> Hi again,
>
> A somewhat related question is also how the heartbeat interval and session
> timeout relates to the poll timeout. Must the poll timeout always be lower
> than the heartbeat interval?
>
> Cheers,
> Jens
>
> On Monday, February 8, 2016, Jens Rantil  wrote:
>
> > Hi,
> >
> > I am trying to wrap my head around the difference between "
> > session.timeout.ms" and "heartbeat.interval.ms". Clearly they are
> > somewhat tied to the same logic since heartbeat value should be less than
> > 1/3 of the session timeout.
> >
> > Let me add some specific questions:
> >
> >- Will a session be considered "dead" if it hasn't received a
> >heartbeat within "session.timeout.ms"? In that case giving
> 2*heartbeat
> >as slack for missed heartbeats seem like a LOT of slack. Given the
> default
> >values, a client will have 27 seconds(!) to be able to send a second
> >heartbeat.
> >- Why can't session timeout simply be based on heartbeat interval?
> >
> > Could anyone clarify this a bit? Also, if you are writing a new consumer,
> > what is your reasoning when setting these two value?
> >
> > Thanks,
> > Jens
> >
> >
> > --
> > Jens Rantil
> > Backend engineer
> > Tink AB
> >
> > Email: jens.ran...@tink.se
> > 
> > Phone: +46 708 84 18 32
> > Web: www.tink.se
> >
> > Facebook  Linkedin
> > <
> http://www.linkedin.com/company/2735919?trk=vsrp_companies_res_photo&trkInfo=VSRPsearchId%3A1057023381369207406670%2CVSRPtargetId%3A2735919%2CVSRPcmpt%3Aprimary
> >
> >  Twitter 
> >
> >
>
> --
> Jens Rantil
> Backend engineer
> Tink AB
>
> Email: jens.ran...@tink.se
> Phone: +46 708 84 18 32
> Web: www.tink.se
>
> Facebook  Linkedin
> <
> http://www.linkedin.com/company/2735919?trk=vsrp_companies_res_photo&trkInfo=VSRPsearchId%3A1057023381369207406670%2CVSRPtargetId%3A2735919%2CVSRPcmpt%3Aprimary
> >
>  Twitter 
>