[Standards] Whitespace "ping"

Dave Cridland dave at cridland.net
Tue Jun 11 14:25:23 UTC 2019


I think the optimal ping, from the server's perspective, radically changes
depending on whether there are outstanding messages, and whether there's an
outstanding XEP-0198 ack.

>From a client's perspective it's really dependent on whether the user is
active, and if not, whether there is a push notification scheme in play.

For the server, I think the ideal algorithm is roughly:

a) If the server spoke last, and there is no XEP-0198 in play, then use a
XEP-0199 ping after N (where N is in the order of 30 seconds). A successful
ping means the client has now spoken last, of course.
b) If the server spoke last and there is XEP-0198 in play, then request an
acknowledgement after M (where M is anything from 0 to about 5 seconds)
after sending a stanza.
c) If the client spoke last, send a ping (XEP-0199 or XEP-0198 <r/>) after
P seconds (where P is in the order of 300). This is purely to clean up old
sessions.

For the client:

a) If the user is active, ping every 2 minutes (perhaps).
b) Otherwise, if there is no push, ping every 5 minutes.
c) Otherwise, don't ping at all.

Dave.

On Tue, 11 Jun 2019 at 13:31, Guus der Kinderen <guus.der.kinderen at gmail.com>
wrote:

> I'd have to check, but I think we're sending a IQ Ping when the client
> misses it's first white space ping interval (whatever we deem is
> appropriate in that server config), and define the client to be
> disconnected when it doesn't respond in a timely manner. This covers both
> of your "the client is being silly" scenario's: to many whitespace pings
> aren't adding much overhead to the server, while to few pings are covered
> by the IQ Ping. I agree with you that it's all very unspecified, which
> could be improved on. I'm not seeing much of a direct  _need_ to do that,
> but I'd not oppose it either.
>
> On Tue, 11 Jun 2019 at 14:24, Mickaël Rémond <mremond at process-one.net>
> wrote:
>
>> Hello Guus,
>>
>> On 11 Jun 2019, at 14:00, Guus der Kinderen <guus.der.kinderen at gmail.com>
>> wrote:
>>
>> What we need basically is a way to negotiate the interval with server
>>
>>
>> I'm not sure if this is _needed_? Without this being a requirement, much
>> of the complexity of "making this more standard" falls away.
>>
>>
>> Well, I think if the server does not have to approve the value, client
>> could expect to set it to something extreme (like 1s) or useless (like 1
>> days). The server could thus reply with a different value. And still the
>> server needs to know at which rate the client is expected to send the keep
>> alive.
>> But, yes, it is always possible to do something like that in a non
>> standard way. My point was trying to agree on something to make life of
>> client developers easier :)
>>
>> A server could, before determining that a connection is lost, attempt to
>> send any IQ stanza (PING is an obvious choice, but any query will do). As
>> the client is obliged to respond, if anything with an error, the server
>> knows if the connection is, in fact, lost.
>>
>>
>> What would be the trigger for determining that the connection is lost and
>> send the ping? Is it whitespace keep-alive or anything else?
>>
>> Thanks!
>>
>> --
>> Mickaël Rémond
>>
>> _______________________________________________
>> Standards mailing list
>> Info: https://mail.jabber.org/mailman/listinfo/standards
>> Unsubscribe: Standards-unsubscribe at xmpp.org
>> _______________________________________________
>>
> _______________________________________________
> Standards mailing list
> Info: https://mail.jabber.org/mailman/listinfo/standards
> Unsubscribe: Standards-unsubscribe at xmpp.org
> _______________________________________________
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20190611/f61b8393/attachment-0001.html>


More information about the Standards mailing list