Adjust Max Message Size for Photon Server

I'm currently trying to adjust the "Max Message Size" and "Max Queued Data Per Peer" to increase the data that can be send over my server. I've already adjusted the corresponding values in the deploy\bin_Win64\PhotonServer.config, the src-server\Hive\PhotonServer.Hive-Development.config and the src-server\LoadBalancing\PhotonServer.LB.Dev.config files.

However, after trying to send a file larger than the initial value of 512000, the client gets disconnected and the logfile deploy\log\GSGame.log tells me that the message size was exceeded. (As seen below)

WARN Photon.SocketServer.Peers.ManagedPeer - Limit exceeded: message size. limit_512000. msgSize_701646 p_GameClientPeer: PID: 11, IsConnected: True, IsDisposed: False, Last Activity: Operation 253 at UTC 2022-09-23T11:11:51, in Room 'Test', IP ***, NetworkProtocol Udp, Protocol GpBinaryV18, JoinStage: 12 , PeerHist_

Judging from this log the message size is still limited to the initial 512000 even though, as far as I can tell, this value is set nowhere in any files and the server has been restarted with the new values multiple times. Which config file do I need to adjust to change this limit?

Thanks in advance!


  • Meep
    Meep ✭✭✭
    edited September 2022

    Hey, this is because of the inbound controller. It was a toolkit added during the 5th generation of Photon servers which acts as an in-house firewall and can apply limitations per operation. You can edit the inbound controller via configuration file, or you can go into Photon.LoadBalancing.GameServer.GameApplication.InitInboundController() .

    At the top of this function, you can specify the limit forcefully like: controller.MaxMessageSizeLimit = 512000 + x;

    Internally, the inbound controller is just copying the value from your MaxMessageSize so you shouldn't be encountering this issue in the first place. However, for some reason the server always has a maximum message size of 512,000 (the default) while initializing the inbound controller at this point. This is maybe a bug.

  • Hi, thanks for the quick answer.

    In what configuration file can the inbound controller be changed? While I can see the InitInboundController function there is no reference to the MaxMessageSizeLimit anythere. I suspect this might be due to a version discrepancy as I'm still on Version from 2021. I will update the server and then mark this thread as answered if I can find the configuration file/"controller.MaxMessageSizeLimit = 512000 + x;".

  • Meep
    Meep ✭✭✭

    Sorry I forgot to mention the line isn't there by default in the function, you have to add it in order to specify the limit, then build the server binaries.