Capture and serialize event stream on the GameServer

Options
ddasin
edited January 2014 in Photon Server
I'm attempting to capture the event stream in the Photon Loadbalancing project. The idea is to track things like player position etc that are automatically replicated as a result of the PhotonView observing a Monobehavior/ Transform / Rigidbody on the client. Basically I wish to serialise incoming event stream to the GameServer to something like a MongoDB instance for analysis later.

As a test I'm putting my code in ExecuteOperation method (in Game.cs) where I'm trying to serilaize a new "RaiseEventRequest" passing in the peer and the operationRequest. Eventually I'll pass on this serialisation to a subserver.

Q: What would be the best way to serialize this data? I'm considering using MongoDB:BSON but at the moment I'm unsure of the performance. Considering this code is going to be called at a pretty high frequency what can be the alternatives? Particularly if someone has done something similar.

Thanks in advance!

Comments

  • Anyone?

    At a push I'd simply ask if anyone (including exit games people) has tried pushing BigData from PhotonServer. If so it'll be nice if thy could share their experience - related to serializing high frequency variable replication data.
  • chvetsov
    Options
    hi, ddasin

    It is difficult to give any advice, beacause it seems, that nobody in exit games has such expirience.

    I think that this is right idea to put connection with DB to some dedicated subserver. I belive that Photon serverialization will work faster then BSON, so it is more efficient to send this events somewhere as PhotonOperations and then somewhere convert this to what you need
  • Thanks for your reply ,Ilya.

    I'll share my results: at the moment I'm working on a proof-of-concept (POC) and I'm just using MongoDB Json (read slow) serialization of the the event stream. This is manageable by directly serializing to MongoDB from the game server itself while the number of concurrent clients is 2-3 (constraint for the POC). . With higher number of clients I can observe the game server slowing down a bit - I'm not sure if this is due to MongoDB's C# driver overhead. I'm not doing any optimization like batching inserts into MongoDB that should give some batching benefits as described by MongoDB docs. I now have a time-stamped event stream that I can play & rewind to generate some stats with respect to time as well as generate some heat maps. I'll develop the subserver once the POC gets approved.
  • chvetsov
    Options
    you could create extra fiber and put serialization tasks there. May be this will make pings better
  • Good suggestion! I'll try that , thanks!