server: fix: stop sending pings on every pong #386

Manually merged
Johann150 merged 1 commits from ignaloidas/FoundKey:reduce-pings into main 2023-05-23 16:13:58 +00:00
Contributor

This resulted in endless ping-pong traffic on the websocket, happening
every interval of network latency to the server (e.g. for me, with 40ms
latency to my server, it was about every 40ms). On my server this ended
up taking about 20% of foundkey's CPU usage. Now, just send pings every
30s, and check if we have received any pong's in last 60 seconds to
check that the connection is still alive.

This resulted in endless ping-pong traffic on the websocket, happening every interval of network latency to the server (e.g. for me, with 40ms latency to my server, it was about every 40ms). On my server this ended up taking about 20% of foundkey's CPU usage. Now, just send pings every 30s, and check if we have received any pong's in last 60 seconds to check that the connection is still alive.
ignaloidas added 1 commit 2023-05-23 08:22:31 +00:00
ci/woodpecker/pr/lint-backend Pipeline was successful Details
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/lint-client Pipeline was successful Details
ci/woodpecker/pr/lint-sw Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details
f7df989679
fix: stop sending pings on every pong
This resulted in endless ping-pong traffic on the websocket, happening
every interval of network latency to the server (e.g. for me, with 40ms
latency to my server, it was about every 40ms). On my server this ended
up taking about 20% of foundkey's CPU usage. Now, just send pings every
30s, and check if we have received any pong's in last 60 seconds to
check that the connection is still alive.

Changelog: Fixed
Johann150 manually merged commit 296c40c5b4 into main 2023-05-23 16:13:58 +00:00
Owner

Thanks for catching this! I don't know how I would have found this otherwise :P

Thanks for catching this! I don't know how I would have found this otherwise :P
ignaloidas deleted branch reduce-pings 2023-05-23 17:21:59 +00:00
Sign in to join this conversation.
No reviewers
No Label
feature
fix
upkeep
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: FoundKeyGang/FoundKey#386
No description provided.