Jump to content
  • Advertisement
Sign in to follow this  
BlackWind

Facebook Game Server Cost

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 a simple game with reasonably little simulation, reasonably little "twitch factor" and reasonable bandwidth, etc. a $29/month server can handle that.

Multiply this by a factor ranging from 1 to 1000, depending on your particular implementation (programming language, game logic, complexity...).

For a game that involves considerable simulation (e.g. birds that can drop bombs and collapse structures), it may very well be that it requires an entire cluster of machines costing thousands per month.

Share this post


Link to post
Share on other sites
Thank you.

i have one question:

Multiply this by a factor ranging from 1 to 1000, depending on your particular implementation (programming language, game logic, complexity...).


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)






Share this post


Link to post
Share on other sites

[quote name='samoth' timestamp='1321459146' post='4884596']
Multiply this by a factor ranging from 1 to 1000, depending on your particular implementation (programming language, game logic, complexity...).

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)
[/quote]

You need to actually look at your game design.

A slow turn-based game where all the assets are already part of your flash executable will be very different from a system where assets are continuously streamed and there is a constant flow of data between clients and servers.

A game design with the work client-side and very light server work will be very different than a system that requires an array of servers for back-end processing.

You already can estimate your number of users. What is your estimated bandwidth at any given time for each user? What is your estimated server and database workload per user? If you know those it is a simple set of multiplication problems. If you don't know or cannot estimate those things then you are simply not ready to proceed with a server estimate.


That leads to the next issue...

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?

If you have to ask how much a server costs, I immediately wonder if your group is qualified to make such a game. You can look that up in a few minutes online, and if your needs are sufficiently big you can negotiate that with your provider.

Building that kind of software requires a team that already has your own in-house network with the minimum server infrastructure. It also generally requires a fairly large team, including a horde of QA testers at the end of the project. Your IT people or purchasing people had better know how to come up with those server cost numbers already. The hardware costs will be dwarfed by people costs, and you should have known that as well.

For another, the team needs to be experienced in order to have a reasonable chance of success. If nobody on the team can come up with reasonable estimates on those basic details, it is a fair bet they will be unable to handle the much harder details of actually implementing the system that requires that hardware.

If your existing team is unable to generate these numbers your first business item should be to hire somebody who does. Asking people on the Internet who have no detailed knowledge of your product and no accountability for incorrect information is a really bad idea.


Hopefully you have let your potential client know your level of inexperience with making such a game. Don't misrepresent yourself in business, very bad things can follow.

Share this post


Link to post
Share on other sites
Ok i need your help to clarify me some things and point me to the right direction.

Making an angry birds clone (with say, the first 10 levels) for iphone can be done with 2 developers + audio + QA

So, assuming i want to port my cloned angry birds iphone game to web (facebook), and expecting 1,000 DAU... why would i require a "large team"? what is a "large team"?
Why would the server may cost thousands of dollars? what type of usage are you estimating?

The biggest confusion comes to me after reading some posts like this:
http://www.gamedev.n...37#entry4884237

where the moderator of this forum is saying:

For something like EverQuest, if movement rules are simple, you can probably do 1,000-5,000 players per server. Again, players only interact within a given server (zone), except for "distant chat." Note: the $169/month server is unlikely to get to the higher end of this range.

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 this post


Link to post
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 this post


Link to post
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!)

1,000 DAU for a game where the server only handles "login" and "score boards" can be handled by a single micro instance on Amazon ECC, at $79/month. And that instance would probably still be mostly idle except during peak time. The bandwidth is likely minuscule for the services -- much more bandwidth from the download of the assets, which you need to put in a CDN of some sort, and you'll pay a per-gigabyte fee there.
I would be more worried about fail-over at that point -- you need to be able to quickly spin up a second copy of your game server if the first one dies, and then the question is where your customer data lives -- lots of start-ups that had their data only in a single availability zone lost a lot when one and a half zone (in Virginia AFAICR) went down earlier this year.
Even 5,000 DAU is small. A single $99 self-managed server, or a $150/month ECC instance, can easily to that. Again, assuming the server just does login (Facebook delegation) and score boards, and no game simulation or real-time communication is needed on the server. Duplicate it, so you know you have a stand-by in the case of failure.
I'd expect the engineering/sysadmin expense of keeping the server running, making sure there's back-ups, monitoring, and taking proper action when it fails, to cost significantly more than the hardware for those numbers.

If your game needs real-time communication, or worse, real-time analytics (for monetization) and game simulation, then these numbers can grow by 10x or even 100x. Else they should just scale with DAU -- multiply by 4 to get 20,000 DAU.
Note that this is assuming that the "DAU" typically will log in once or twice, and update a scoreboard about once every minute for a game session of 10-30 minutes -- pretty average.

If you have no idea what you're doing, if you're hiring people who are using the wrong tools, if you're building some kind of feature that is non-vanilla for the kind of game we're talking about here, if you want more redundancy, ... there are many reasons why these estimates can easily go off by 10x.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!