Author Topic: question before I buy and port from Photon to TNet  (Read 5593 times)

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
question before I buy and port from Photon to TNet
« on: March 28, 2014, 11:02:32 AM »
Hi ArenMook, can I get your gut feeling about the question below?

The ability to host a authoritative+master servers on Linux / Mono .NET is very appealing to me because the cost of Windows VM is 33% more expensive on my cloud provider of choice (Azure). In other words, I could be saving 33% on a monthly basis, right into my pocket, if I used a Linux VMs instead of Windows VMs.

*except*

As we know, IO completion ports are not available on Mono. So the ability to handle many concurrent requests is inferior on Linux. In your gut feeling, regarding scaling out to hundreds or thousands of players, would this performance hit be > 33% vs Windows? In other words, on equivalent hardware, would a Windows TNet server be able to host > 33%  more users than a Linux TNet server?

Thanks





ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: question before I buy and port from Photon to TNet
« Reply #1 on: March 28, 2014, 11:53:11 AM »
I honestly can't answer this question as I don't know what kind of performance benefit comes from using IO completion ports compared to not. I just know that they're faster, but don't know the numbers.

I can tell you this though... Mono is most likely going to be slower than .NET. If you are running the TNet server (the 50 kb executable), it will run using .NET on Windows, which is most likely going to be faster than Mono of OSX/Linux.

When you say "authoritative + master servers" though, what do you mean exactly? TNet uses authoritative client approach, not servers. The closest comparison of TNet server is to that of an IRC server. It can have many channels inside, and many people connected, but it won't run any game logic unless you add it yourself (and in most cases you shouldn't). Authoritative client-based approach results in a significant reduction of resource usage compared to an authoritative server.

I hosted both the lobby and the game server for an entire year on a the free Amazon EC2 instance quite happily, to give you an example (for Starlink).

mindlube

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 46
    • View Profile
Re: question before I buy and port from Photon to TNet
« Reply #2 on: March 28, 2014, 02:49:54 PM »
Thanks for the feedback, that's very helpful. I went ahead and bought TNet, for future projects. Maybe I will use it for this project.

Actually my server wont be authorative, exactly, but I would definitely need to add some custom code to the server. This is (still) my dominos game I'm adding network play to. So it's turn based and async, with persistent games. I want to allow players to just play matches and not have to pick from a list of servers. The design I came up with with Photon Server,  in a cluster, which seems to be working pretty well is this

[unity clients] <-> [photon1] 
                             | zeromq pub/sub
[unity clients] <-> [photon2] 
                             | zeromq pub/sub
[unity clients] <-> [photon+n] 


One change I plan to make is for the backend to save game states to Cloudant, instead of disk.