Server Restarts

I have a self hosted Photon Server running Plugin SDK v5.
The game that uses this server is a FPS game.
I have to restart photon every couple of days as lag is introduced. RPCs are occasionally not handled on devices (I know they run reliably so not sure why that would happen, is there any instance where RPCs are not handled?).
Lagging starts to get up to about 2 seconds instead of the original 200ms. Photon is seen to be using 350mb of memory when delay starts but usually runs quite stably at 230mb.

The maximum CCU running on the server is 40 with all the players in one room. There is no reason for photon to be at 350mb as the FPS game runs quite well with these 40 people in the one room. It is only over time where issues start to happen which are eliminated on photon restart. Is there any known bugs or issues with memory leakage? Are there any fixes to handle this?



  • iampoole
    edited June 2021
    On further inspection, it seems that the photon service increases in around 0.5-1mb increments of memory usage with each new room/game.

    Also, when I first restart the server, it runs fine with at 150mb. So maybe games are cached after completion?
  • hi, @iampoole

    I do not know about any reason why room would be kept in memory when all players left. Photon allocates 1 Mb of memory for the thread that does serialization. That may explain why you see 1Mb grow. The more threads is used the more memory is consumed. but it is finite. I mean 700 threads will consume 700 Mb, but that means that something is wrong we your server code. Number of threads is usually much less.

    did you update anything server side? do you have a plugin? are you caching events?
    could you provide us memory snapshot done by MemProfiler?