Photon Server timeout disconnect
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on Photon Server.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
Photon Server timeout disconnect
whitebox
2015-07-24 04:53:10
Hi All,
I am working on a 3d online game, server is using photon sdk version 3.4.28.8401, and client is unity 3D. And I usually meet the timeout disconnect from server .I run both client and server on my local, open 15 clients instance connect to server ( master and sub server ) and each client send and receive data in 0.05 second, some time some of 15 clients disconnect to server , somes still alive. When disconnect . server return the DisconnectionTimeout . I don't understand if timeout then why not all of clients disconnect , and each client send data continuosly to server so why the server tell disconnectiontimeout. Would you please here to explain me. I'm appriciate it.
Thank you for reading.
Comments
[Deleted User]
2015-07-27 10:36:04
Hi!
A "timeout disconnect" from the server means that one of your clients was not able to send an ACK(nowledgement) for received data to Photon for a certain time. So you see that your clients can not "catch up" with the amount of data you send to them. There might be different reasons - i recommend that you check this article:
https://doc.photonengine.com/en-us/server/v4/performance/analyzing-disconnects
Especially the "send less" and "call Service() regularly" topics might be interesting.
Out of curiosity, are the 15 clients all in one room? In that case, you have a lot going on:
15 clients x 20 messages / sec = 300 incoming messages / sec
Or, to put it the other way round, each of your clients need to handle 300 msg / s - that is quite a lot for one client!
Photon (server side) can handle this quite well, and 300 msg might sound little, BUT every message needs to be sent to all other 14 clients of the room, plus an operation response is sent back to the sending client:
300 incoming messages / s x 15 receivers = 4500 msg / s / per room.
That is already a lot - and might add up to significant load / traffic on your server side, too, when you have more users.
Please read this article here as well:
https://doc.photonengine.com/en-us/server/v4/performance/performance-tests
As a comparison, for Photon Cloud, we allow / recommend a limit of 500 msg / s / room - especially to aovoid client-side issues.
So - rule of thumb: the more clients, the less you should send. 20 msg /s is fine for ~ 4 players per room - if you have 10+, you should reduce send rates or you might look into interest management to avoid sending stuff that the clients are not interested in at all.
Good luck and let us know if you need more help!
Thank you for your explanation.
Clients for a room is unlimited . And we have 3+ rooms in game for different context.
Server has a list to store client's info connect to it ( call list A ). Everytime 1 client has changed then server will send this changing to another clients in same room , in this case we use "send event" method. Instead of , I use list A "for loop" to SendOperationResponse to another clients in same room, server knows exactly clients will receive this message. What is different if I don't use "send event" ( broad cast ) method .
Back to top