views:

340

answers:

5

Have you ever encountered something so easy to develop but stopped a while to think of server requirements for your project ? It is my case.

I want to compete with a gaming site, they have multiplayer Flash games like poker, rummy, backgammon, and other card games, 8 games in total. For each game they have rooms and tables.

I'll use Silverlight with Sockets. I already managed to develop the policy server, the Socket Server app using WinForms, the Client Socket app in Silverlight. I own a VPS for tests, so there is no problem in developing what I want, the problem is How to calculate server requirements, RAM, bandwidth, internet speed based on the following requirements:

  1. Server should support 24.000 users / day or 1000 users / hour
  2. Each game room should have it's own tables where users can play
  3. Users should not lose scores and game speed should be fast in general

I just wonder how to handle the following situation: if 1000 users are connected through Socket connection to a room full of tables and one user leave a table, all 1000 users must be updated and UI should reflect the changes. Let's say that I'll update the clients by sending a small Message of 100 bytes to each user, this will eat 100 bytes * 1000 users = 100 kb, and this just for 1 UI change, for 1 Game and for 1 Room, not counting all my other games and rooms. Also 1000 iterations that sends bytes to clients should be very time consuming.

I am a developer, but not experienced in those situations. Please advice. Numbers will be great.

+2  A: 

The best answer I can offer you is to run stress tests and see how much load a single server can support. While running those tests, monitor memory, IO, CPU and disk activity (if relevant) to understand which resource is running out first.

We deploy our applications on Amazon's EC2 cloud infrastructure. That lets us easily (within minutes) add or remove capacity as needed. Perhaps it's worth considering for your situation.

Eric J.
+4  A: 

Until you've built -- and optimized -- your actual applications, you cannot predict much about the hardware required for some level of performance.

You have to finish the apps first. Then you can measure their performance under load. Then you can decide how much to spend on what levels of performance.

S.Lott
Completely agree... and to be honest, these sorts of questions are usually easier to solve than is the problem of making a fun game that people actually want to play!
dicroce
+1  A: 

Always follow these two rules

“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

Aaron M
A: 

Hello

First of all you should think more about how and when to send what information to which clients. Not every client needs to be informed about every table change.

That there are only so much informations that a client needs, and you need to decide when/how it will be transmitted. Also you should pack the informations into meaningfull packets. Whats happening at a table is only interesting for that table.

Also you need to profile your application to make sure you know what ressources it consumes. Cardgames should not eat up so much ressources. But the important point is to FIRST build it, and when you HAVE a bottleneck, then try to fix it.

Heiko Hatzfeld
A: 

It's very difficult to guess at these things at this point.

From a pragmatic standpoint, you may eventually want to look into a) a cloud-hosting type service for better bandwidth price-scaling for you, or b) a very experienced full-service hosting company that can help you calculate your needs based on prior experience.

Disclaimer: I work for Rackspace Hosting which provides both of the above.

phoebus