This topic is 2877 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi,

We received and offer for developing a facebook game. Its a simple one (like angry birds).
The DAU expected goes from 1000 to 5000
So, how much does a game server to handle that will cost? Which options can you recommend me?
And also, what about a game server for 10,000 to 20,000 DAU?

thank you!

##### Share on other sites
This is a hard or impossible to answer question, first because it is contradicting (angry birds is not at all "simple"), because the numbers you give (1000 vs 5000) are quite different, and because it depends greatly on your game.

Nevetheless, let's make some assumptions:
- most people will not play all day
- players are not evenly distributed over the day's 24 hours, since many play after work or such
- this means there are several kinds of "rush hour" to be expected, e.g. for Asia, EU, and US evening times.
- let's therefore assume that most load will be within 3x 3 hours = 9 hours
- this means your server must handle between 110 and 550 concurrent users

For something like chess, or scrabble, where the game is turn-based, and the communications overhead is simple, you may be able to get 10,000-50,000 players onto a single server. Again, a $169/month server is unlikely to reach the higher end of this range. BTW, i did told the client we have no experience in online games, so i will have to hire people who does. But first i wanted to do some research so i have a better vision of what will we be facing. thank you in advance. #### Share this post ##### Link to post ##### Share on other sites This factor ranging from 1 to 1000... what would be an example of how can i say: "it will be in the 100-200 range" ? How can i have some estimations? any formulas? (assuming that all your assumptions are true) That factor is the "unknown factor" which represents what I don't know about your game. A shooter has different characteristics both in simulation complexity, timely constraints, and bandwidth than e.g. nine men's morris, and a software written e.g. in C runs at a different speed than a software written in e.g. Ruby (a difference of roughly 1:50). A badly chosen algorithm can run a hundred times slower than a well-chosen algorithm (... or, in the worst case, a billion times). Thus, a game "something easy as angry birds" might exist in two entirely different universes, depending on such insignificant details. It is impossible to tell more. What you need to know (re "formulas") is how much the server must be able in the worst case at the worst time (not best, not average!), and what it can handle. You assume 5000 daily active players. A day has 24 hours, so naively thought that's 208 players at a time. However, players are not evenly distributed. Many will play after work, and many will want to play with their friends, which means that the vast majority will be online within some constrained time. I have assumed 3x3 hours = 9 hours for that, giving 550 concurrent users (same number of people in fewer hours ---> more people at a time). Again, there is an "unknown factor" here. If you make e.g. a game in French or German, you will not likely find many Asian or US players, the time interval with the most players will be yet smaller, say 3 hours instead of 9. In that case, you'd have 5000/3 = 1600 concurrent users. You can see it the other way around too. If you know, according to your target audience, you will have e.g. 1000 concurrent users at most at any time, and you have a 2 GHz server, then you have 2 million cycles available per user every second. If your server runs e.g. 4 "simulation ticks" per second, you have a budget of 500,000 cycles. Whatever you do, it must fit in those 500,000 cycles. If it doesn't, you must buy more servers or a bigger server. If you run 20 "ticks" per second, you have a budget of 100,000 cycles. #### Share this post ##### Link to post ##### Share on other sites How is Angry Birds-like game played? 1) User goes to a web page 2) Their profile/account is loaded from Facebook and custom account 3) They select the level 4) Play for 30 seconds 5) Final score is uploaded, maybe leader board is updated 6) Go to 2 or 3 The following costs can be inferred: 1) HTML/CSS/Flash assets are downloaded, these can also be cached 2) Server needs to fire a set of Facebook API queries and ideally a single local DB query 3) Level select can be hard-coded in the client or it can be extra DB query 5) Another DB update query, perhaps another to update stats 1) Will be served off CDN or static file server, the variable is bandwidth 2) Will involve several HTTP requests + 1 SQL query 3,5) Will involve a minimum of ~3 SQL queries The limiting factor now becomes local SQL server. Rule of a thumb says that SQL server peaks at 1000 simple transactions per second. Given 30 second play time with 4 queries per play we end up with peak of 15,000 plays/minute or 250 concurrent plays per second. Let client assets be 4MB. 250*4MB = 1 GB/second. Or, given influx of new users that do not have cached assets, static content will be the bottleneck. So in order to serve the peak the CDN will need to serve 1GB/sec at peak. If serving from custom machines, that would be ~5-10 machines. 20k DAU, assuming cold start for each means 80GB traffic per day. This averages out to 1MB/sec, which is somewhat of a more realistic number. 20k users at average of 20 plays each(?) is 1.6 million SQL queries per day or 18 SQL queries per second. Given larger sample size, traffic becomes more predictable, so let fluctuations be factor of 5, giving max bandwidth of 5MB/sec and ~100 queries per second. Hardware costs: A single standard EC2 instance costs ~$70/month. That would cover the DB server. While a single server would suffice in ideal case, the number of queries is likely to increase in practice. We also need to cover for unpredictable overhead, so having two should cover the peak load as well. Splitting static assets across two servers adds two more.
Bandwidth is trickier. It's hard to determine the static vs. dynamic loads, but the former should dominate by far. At above stated estimate of 1MB/sec we'd need ~2TB/month. EC2 bandwidth would come out to ~$200/month. Not counting the load of FB API (don't recall the details), extra load (ads, analytics, logging, metrics, ....), the minimum cost of server setup estimated for 20k with daily peaks would come start at$500/month.

Bandwidth is likely to be lower. SQL transaction rate is also likely to be lower. The above just gives a starting point.

Cost of administration, support, on-call troubleshooting and everything else is not included. These costs can be trivially an order of magnitude higher.

Also, this is the type of analysis is what the developer provides for a client. Having random guy from internet do it may mean the numbers are correct, or so wrong that they will bankrupt you and your client. But hey, it's free, so no complaints. Also, any of the calculations above could be off by a factor of 1000.

##### Share on other sites
Two reference points with actual data I didn't pull up before. Here and here. First part is relevant, the second goes into scaling well beyond that, but I prefer the dumbest LAMP approach for initial estimate, there's still factor 10 usually hidden in caching and similar tweaks.

Compared to that, my estimates are somewhat conservative. The SQL setup goes up to 200k uniques per day with DB write once every few seconds on 2+2 SQL servers and some 10 app servers. So the low end estimate for twice-per-minute DB access seems to be a roughly accurate ballpark figure.

So to get estimate on operations, take $500, round it up to$1000 and double that. That's what is typically billed to client.

##### Share on other sites

We received and offer for developing a facebook game. Its a simple one (like angry birds).
The DAU expected goes from 1000 to 5000
So, how much does a game server to handle that will cost? Which options can you recommend me?
And also, what about a game server for 10,000 to 20,000 DAU?

I will not talk about building the game, testing it, tuning it until it's fun, then tuning it again until it's great. That can take a year, even with very good designers. (It certainly took more than a year for Angry Birds!)

• 18
• 13
• 9
• 9
• 25