peers / peerjs-server

Server for PeerJS
https://peerjs.com
MIT License
4.26k stars 1.08k forks source link

fix: reduce unnecessary timeouts #436

Closed jonasgloning closed 7 months ago

jonasgloning commented 7 months ago

Intensive throttling might result in heartbeats being sent only once a minute. For more information, see https://developer.chrome.com/blog/timer-throttling-in-chrome-88

I increased the timout of the public instance to 90s. Some early results:

SELECT 
    (filter(count(*), WHERE duration >= 85 AND duration <= 95) * 100) / filter(count(*), WHERE transactionType = 'Other') 
    AS 'Percentage of Requests in 85-95s Range'
FROM 
    Transaction 
WHERE 
    entityGuid = '....' 
    AND transactionType = 'Other' 
SINCE 
    1 day ago
Interval 60s Timout 90s Timout
55s-65s 14.3% 4.55%
85s-95s 1.55% 7.53%

Approximately 12.75% (14.3% - 1.55%) of connections were terminated due to the timeout, while only 2.98% (7.53% - 4.55%) were actually dead.

github-actions[bot] commented 7 months ago

:tada: This PR is included in version 1.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 3 months ago

:tada: This PR is included in version 1.1.0-rc.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: