Game Development Community

10,000 players

by Joel Reymont · in Torque Game Engine · 02/24/2005 (4:44 pm) · 43 replies

Folks,

I'll state upfront that I'm writing a poker game so the only parts of Torque that I'll be using are the GUI and networking. Yes, I might go with the upcoming T2D if networking is the same as in TGE.

What do I need to do to support 10,000 players on my server? Poker is a turn-based game so assuming 10 players per game and 1000 games running, I will only be processing 1000 requests at one time. Packets are rather small too.

Thanks, Joel
Page «Previous 1 2 3 Last »
#1
02/24/2005 (5:01 pm)
I was under the assumtion there is no real limit to how many players enters a game. However 1 game is 1 server. I am not sure how to break 1 server to monitor multiple games.
#2
02/24/2005 (5:09 pm)
Let me explain... Lets say it's one game in Torque-terms and 1K network packets at the same time from 10K connected players. Is this possible? All my players will be doing is sending requests like "call 10", "fold", "raise 20", etc. the server will process the request and notify up to 10 other players by sending packets like ... "call 2 10", "small_blind 1", etc. to each one.

That's all there's to it, it's a card game. No 3D, no physics, fog, terrain, etc.
#3
02/25/2005 (1:29 am)
You would need 78 MegaBits per second of bandwidth if ALL 10,000 players needed a 1K packet at the same time. However, this could probably be done with even less packet info than that. Maybe as little as half of that amount 40 Mbps, and then assuimng 20% constant load you would need 8 Mbps to hold 10,000 in theory.


Assuming a run rate of 50% fulltime you could figure 6.5 TB's of bandwidth a month at 10,000 users. Obviously this is not an ideal setup unless you think you are going to be running 10 servers at 10,000 apiece because if your one server goes down you would lose all 10,000 players at once and then you would have a massive bandwidth hit on everyone trying to rejoin at the same time and such. What you need are more computers and more IP's. Right now you could get 4 dedicated XEON servers for $1800.00 per month and run 6 servers of 4000 each and get 24,000 and have 2 servers on standby to handle up to two crashed servers worth of players.


Yes, this could be done and would be fun to do at that. If your looking for a joint venture with one or more persons you should contact me sometime.
#4
02/25/2005 (1:45 am)
Massively Multiplayer Puzzle Poker eh? First Joshua Dallman does a turn based FPS and now this ... what else is on that darn banner ;)
#5
02/25/2005 (2:12 am)
I'm glad this could be done.

Gonzo, spreading the load is the way to go but there's nothing wrong with claiming you could do 10K players per server when your competition can't ;).
#6
02/25/2005 (3:22 am)
I honestly Don't see a packet issue. Gonzo's figures are correct but that is assuming a LOT of packets being sent and it taking a good long time for each packet to pass.

I don't know how Torque handles everything. Sure if it was a tcp/ip deal and you had to have package checking it may be a lot. But sending information UDP or otherwise, I don't think you would need anywhere near the kind of rig Gonzo is stating.

I mean if every user needed 1k packet transfer, its not like its a constant transfer or that everyone is going to need all of it at the same time every time.

I guess it really depends on how torque handles packets, marshaling, ques, etc....
#7
02/25/2005 (4:26 am)
Charlie, I'm waiting for someone from GG to respond. My packet size should be WAY less than 1K, maybe 256 bytes with encryption.
#8
02/25/2005 (6:19 am)
Charlie

Yeah, I did blow up on the specs a little. No need to rush out and drop a few grand on servers yet, lol. I was just trying to give him a feel for what kind of power and bandwidth he would need to scale up wisely and just how fast that bandwidth can add up. If you just wanted to prove 10,000 could be done on one computer, I would attack it with a Dual HyperThreading XEON System with about 5 Mbps(CONSERVATIVE figure of 200 Bytes per user and 1 update per user every 5 seconds) of bandwidth. Run one instance on each CPU, then daisy chain those two TGE's and allow 5000 players on each. About a month or two of work to get a serious prototype up and running. In fact, to prove the concept, once I had established the linkup between the two TGE's i'm pretty sure I could make those two TGE's connect to each other 5000 times(One hosting, one playing) to see if it would handle the connections. And what type of CPU loads it would pull down, etc...
#9
02/25/2005 (6:58 am)
Actually, I'll just try it on my Powerbook G4 1.25Ghz and 512Mb of memory and see how high I can go. I'm certainly not gonna spend time linking TGEs. If push comes to shove I'll just do a simple networking layer in Lisp using UDP (my poker engine is written in Lisp) where I ack every packet or something like that.

My goal is not to figure out how much bandwidth 10K players will consume, I'll help my customers with that simulation once they are ready to roll. I just want to prove that it's possible to have 10K players connected to my server and 1000 games going at reasonable speed.
#10
02/25/2005 (8:27 am)
Hate to beat a dead horse here but it looks like this conversation got a little distracted by a mis-communication re: network bandwidth. As I understand him, Joel never mentioned 1K packets, he was talking about 1000 PEOPLE sending packets.

From the look of things it looks like each packet could be on the order of a few, i.e under ten, bytes. If it were me, I'd make each of the "commands" be encoded to one byte each, with the arguments being two or three more bytes, (i.e. "raise 10") , so overall it should be tiny.
#11
02/25/2005 (8:33 am)
Hate to beat a dead horse here but it looks like this conversation got a little distracted by a mis-communication re: network bandwidth. As I understand him, Joel never mentioned 1K packets, he was talking about 1000 PEOPLE sending packets.

From the look of things it looks like each packet could be on the order of a few, i.e under ten, bytes. If it were me, I'd make each of the "commands" be encoded to one byte each, with the arguments being two or three more bytes, (i.e. "raise 10") , so overall it should be tiny.
#12
02/25/2005 (8:47 am)
You are dead on Chris! I do not care about bandwidth at the moment. I do care about memory Torque and performance of Torque with 10K active players sending small packets. The packets are strings at the moment but I'll certainly go binary if need be.
#13
02/25/2005 (9:15 am)
Just as an FYI (ignoring encryption for the moment), if you actually sent these as tagged strings via commandToServer, the packing will already be done for you.

TGE (if you use tagged strings) already creates and maintains a string table for each client server and client side, and only sends an id of a string, so you would send 'Raise' , 10, and the 'Raise' part would be packed.

I don't see anything major (other than modifying the hard coded "limits" on number of players in a game, which is relatively trivial) that would even require code base changes for what you have described so far--should be able to do most of this in script.

Interestingly enough, this would be even better implemented in T2D when it comes out--I know that they don't have completely full networking yet, but from what little I know, the networking they do have in place should work, or be real close, for what you want. You could run the server as TGE if you like, and implement the client side stuff in T2D.
#14
02/25/2005 (9:25 am)
Stephen, I'm waiting for T2D to come out. I would make more sense to implement a 2D poker client using it than TGE.

Where would I look for built-in player limits?
#15
02/25/2005 (9:56 am)
I think there is one value set script side, probably in /server/scripts somewhere, as well as a few places in the C++ code. I can't really point you in any better places then that, although you'll want to become very familiar in the networking code in the first place to make sure you optimize your networked data, so you may just want to sit down and start reading the code (and the comments in the .h files) themselves.

[shameless plug]
I just recently finished off a summary/overview of the TGE 1.3 Connection Sequence Overview which could be used as a very good introduction to the networking code in all it's layers. It won't explain your question(s), but it will show you many of the key places to begin research.
[/shameless plug]
#16
02/25/2005 (10:05 am)
Stephen, thanks for the pointer. I found your overview this morning and saved it for later reading :D.
#17
02/25/2005 (4:12 pm)
This would be so easy to do you would laugh all the way to the bank.
Your messages could easily be compressed to just a couple bits and with no
collision/physics/expensive ai/movement/prediction/etc etc etc
you could easily get torque to do this for you.

you would probably spend a good amount of your time (if money is involved) getting it
extremely secure and locked down from cheating/abuse/etc.

i doubt any of your messages would be more then a few bytes and chances are it could be squished into a few bits.

so 10k players hitting a button at least once a second each message is say (something ridiculously big like 10bytes is 100,000 bytes per second or 800,000bps.

worse case, a t1 which is 1.5mbps, I seriously doubt your messages would need to be that large, and players probably wont be clicking that fast either so I think this is totally doable.
#18
02/25/2005 (4:23 pm)
Would there be actual money being dealt (it is poker). if so that would double the importance of the cheating/abuse/etc protection themartian suggested
#19
02/26/2005 (12:36 am)
Thank you folks!
#20
03/04/2005 (11:49 am)
Well, I think I can now scale well beyond 10K players. Architecture here: http://wagerlabs.com/tech/2005/03/massively-multiplayer-prevalence.html
Page «Previous 1 2 3 Last »