Pros and cons of changing client timeout value

All Union Platform questions, comments, feature requests, and bug reports.

Pros and cons of changing client timeout value

Postby toby » Thu 01 Nov 2012 19:34

Q1) I would like ask what the benefits and disadvantages might be of
increasing the client_timeout value from the default of 30 seconds to something
like 90 or 120 seconds.

Would it simply be that a true disconnection would take longer to figure out?

Here is why I ask:

on two occasions now, we have seen a "mass disconnect", where a whole bunch
of clients get disconnected at about the same time, over the span of
one or two minutes.

My guess is that it's some brief hiccup on the server's network connection,
since the server just kept running fine before during and after this brief period.

If that's correct, then it seems that a little more patience on judging a client disconnected
would take care of any such problem, as long as it was of short enough duration.

Q2) Along the same lines, it would seem that increasing the time between heartbeat
messages would greatly reduce the amount of message traffic. Would there be any
disadvantage to that?

Obviously it needs to stay quite a bit shorter than the timeout time,
but what would be a good set of values?
I'm thinking 15-20 seconds for heartbeat interval and 60-90 seconds
for client timeout.

Has anyone experimented with these values to find a good combination,
other than the default of 10/30 ?

Thanks for any insight you can give on this and any other suggestions
for things that might help.
toby
 
Posts: 162
Joined: Sun 24 Jun 2012 14:18

Re: Pros and cons of changing client timeout value

Postby derek » Tue 06 Nov 2012 14:58

I can best answer Q1 by giving you some more detail on the actual mechanisms involved.

The server will accept any kind of client communication as an indication of a client being live and is not tied to a specific client message (eg. heartbeat). The check for client timeouts does occur in batches rather than by individual client.

So seeing a bunch of clients disconnect together would be exactly the kind of behaviour you would expect during a server hiccup. It also means clients won't timeout at exactly the client_timeout but will instead timeout somewhere between the actual timeout value and a max of 125% of the actual timeout value. For example, for a client_timeout of 30 seconds the actual timeout would occur between 30 and 37.5 seconds.

The benefit of a longer timeout is that you are less vulnerable to false positives or clients that are actually live but have either not communicated recently or were unable to communicate recently (eg. lag).

The disadvantage of a longer timeout is that ghost clients (i.e. clients that have disconnected but the disconnection has not been surfaced to the application) will stick around longer in the application.

Detail on Q2 will follow in a separate reply.

Cheers,

Derek
derek
 
Posts: 68
Joined: Mon 17 Oct 2011 19:12


Return to Union Platform

Online

Users browsing this forum: No registered users and 1 guest