Photon Loadbalancing Errors Spam

edited October 21 in Photon Server
I am using Photon Server. Periodically I can see the "Can't optimise broadcast to disparate peers" error. I couldn't find anything on google. So does anybody know what problem it is and how to fix it?
Sometimes clients can't connect to master for 10+ minutes. I think that this error can be the source of my problem


  • hi, @Sergey

    Do you have different clients which use either binary protocol or JSON protocol?

  • Thanks for an answer, @chvetsov
    All of our clients are using binary protocol
  • >Can't optimise broadcast to disparate peers

    this bug is some internal issue of managed part of photon socket server. It does not break anything. this is rather a performance issue. Also, it is not the reason why you cannot connect to the master server.

    Please check that you do not set AutoJoinLobby flag. Usually this is an issue, because master starts to send to clients all rooms in lobby and this takes ages and kills clients

  • Yes, you're right. We are using AutoJoinLobby flag because there is only one lobby on our server.
    Average online ~500 clients, max players in room always equal to 2, so the average count of rooms is 250+-
    Also I want to say that we are using SqlLobby type (maybe this information could be useful).
    Can you please explain why sending all rooms to clients takes a lot of time?

    P.S. Sometimes on PhotonLoadBalancing logs I can see these messages
    "CTCPWebSocketServer::ReadCompleted - Exception - TWebSocketBase::Read() - Socket is closed: 0000000009DB5A30"
    "CTCPSocketServer::OnError() - TAsyncSocket::Shutdown() - An existing connection was forcibly closed by the remote host."
    "CTCPSocketServer::OnWriteCompletionError() - Flow control - Connection aborted due to - An existing connection was forcibly closed by the remote host."
    Are those errors part of our issue or they can be ignored?

    Thanks again for you help, @chvetsov
    Much appreciated!
  • >Are those errors part of our issue or they can be ignored?
    they can be ignored.

    well, if you have just 250 rooms this should not be an issue. probably you also generate a lot of updates for lobby properties. So that rooms are updated constantly.

    Not sure what else it can be. Next time when you see this issue (client is not being able to connect to master), please try to connect with a modified client, which does not use AutoJoinLobby. If it works, then that is the issue. if not we will dig more

    All more or less successful titles face the same issue with AutoJoinLobby.

  • SergeySergey
    edited November 28
    Thanks for help again @chvetsov
    It's turned out that there was unoptimised query to database server before getting information about all the lobbies.
    How can I close discussion?
  • hi, @Sergey
    You should not do anything special. We are glad to know that you managed to find a reason for your issue

Sign In or Register to comment.