OngoBoingo
OngoBoingo

Reputation: 149

Socket.io pinginterval's impact on server performance

I have an app that connects to a node.js server using socket.io. I'm having some trouble with users disconnecting due to the bad network. And due to this issue, I would like to show the client the current latency on the server, just so the client is aware if they have a "bad connection".

My server uses defaults currently and pings the client every 25 seconds. I would like to set my pingInterval to 3-5 seconds instead to show a more updated latency-status.

But I'm unsure if this could affect the server? I have peaked at 800 simultaneous users being connected at one time.

Could this become a performance issue, if the server has to ping 800 clients every 3-5 seconds instead of every 25 seconds?

Upvotes: 1

Views: 590

Answers (1)

OngoBoingo
OngoBoingo

Reputation: 149

I have now changed the pingInterval of the server from 25000(default) to 2500, and this seems to have no impact on performance (testet with 290 simultaneous users)

Upvotes: 1

Related Questions