Hello,
i got a question about the performance.
I want to build a flash racing game, it would be in the style of Haxball www.haxball.com http://www.youtube.com/watch?v=z_xBdFg1RcI
As you can see a pretty simple game. The players got the option to create rooms and play with a maximum of 8 players in one room.
Haxball runs on p2p but i want to run it on real servers so that lag is no issue.
My question is how much players do you think a virtual server could handle? (for example from linode)
I know that it could vary depending on netcode etc but i just want some rough numbers because i dont really got a clue if a server could handle 500players or even 100players!
How much players could it handle?
Guestimate (sp) is about 2-7 KBps per player optimized for a simple realtime twitch game. You might be able to get it even lower but for a illustration purposes, lets say you get down to 2 KBps.
A Linode server is more transfer limited so you'll likely hit the Linode512 monthly cap of 200GB at about 40 users assuming they play 24 hours a day.
You can try different VPS providers as some are more bandwidth friendly. I use Google for calculations since they do conversions quite nicely.
For example, just enter
2 KBps * 40 * 30 days
and it'll give you (2 KBps) * 40 * (30 days) = 197.753906 gigabytes
Another thing to be wary of is the port bandwidth speeds. Assuming unmetered bandwidth, most cheap VPSs will be 10Mbps, which gives you an upper limit of about 600 users. Realistically, its a shared port, so you won't be able to get more than 20% of that before they ask you to go dedicated or upgrade.
And unless you get up to the 300+ users, I don't think you have to worry about CPU usage. Of course, for that one, mileage may vary drastically depending on game and code.
A Linode server is more transfer limited so you'll likely hit the Linode512 monthly cap of 200GB at about 40 users assuming they play 24 hours a day.
You can try different VPS providers as some are more bandwidth friendly. I use Google for calculations since they do conversions quite nicely.
For example, just enter
2 KBps * 40 * 30 days
and it'll give you (2 KBps) * 40 * (30 days) = 197.753906 gigabytes
Another thing to be wary of is the port bandwidth speeds. Assuming unmetered bandwidth, most cheap VPSs will be 10Mbps, which gives you an upper limit of about 600 users. Realistically, its a shared port, so you won't be able to get more than 20% of that before they ask you to go dedicated or upgrade.
And unless you get up to the 300+ users, I don't think you have to worry about CPU usage. Of course, for that one, mileage may vary drastically depending on game and code.
We are on theplanet and we easily have 10 000+ concurrent users during peak hours. And this is SFS1 i am talking about, with SFS2 the optimizations can be even greater. The main thing is optimizing your code, nothing else, sometimes its good to be limited by HW/Hosting since it forces you to optimize to your best ability instead of falling back on the hw.
Pushing the limits of flash platform at http://blog.flash-core.com
-
- Posts: 1297
- Joined: 14 Mar 2008, 07:52
- Location: Sweden
shtif - what type of game is that, and how many servers?
Any tips and tricks you can share with everyone?
/Thomas
Any tips and tricks you can share with everyone?
/Thomas
Full Control - maker of Unity/C# and Java SFS API and indie games
Follow on twitter: http://twitter.com/thomas_h_lund
Follow on twitter: http://twitter.com/thomas_h_lund
ThomasLund its a dice game so not much traffic going on fortunately and it runs on a single server. Limitations were needed only in lobby rooms where it was simply not possible to handle many users within a single lobby (updating variables/counts).
Other optimizations were doing everything in pure string packets, disabling events for room creation/deletion since there are thousands of rooms at a single time which create/delete quite quickly. So i created custom notifications about particular rooms once user is going to work with that room. The thing is to avoid data distribution that is unnecessary which means you need to customize everything instead of going with the native SFS events when you reach bigger numbers. Also custom room list upon login that doesn't include game rooms but only valid lobbies. There are other optimizations but these were the major ones.
But now with SFS2 you can breathe way easier, the major thing for me was that you don't need to join room or even request room list when you login. I am working on another project right now based on SFS2 which will reach high numbers and we are working on the dice game SFS2 version as well so if there is something interesting to share along the way i will probably post it
Other optimizations were doing everything in pure string packets, disabling events for room creation/deletion since there are thousands of rooms at a single time which create/delete quite quickly. So i created custom notifications about particular rooms once user is going to work with that room. The thing is to avoid data distribution that is unnecessary which means you need to customize everything instead of going with the native SFS events when you reach bigger numbers. Also custom room list upon login that doesn't include game rooms but only valid lobbies. There are other optimizations but these were the major ones.
But now with SFS2 you can breathe way easier, the major thing for me was that you don't need to join room or even request room list when you login. I am working on another project right now based on SFS2 which will reach high numbers and we are working on the dice game SFS2 version as well so if there is something interesting to share along the way i will probably post it
Pushing the limits of flash platform at http://blog.flash-core.com
Who is online
Users browsing this forum: No registered users and 70 guests