Search code examples
iphone.nethostingcloudbandwidth

Hosting needs for a turn based iPhone game


So i've been spending some time developing an iPhone app - it's a simple little game and is similar to "Words with friends" in that it:

1) is turn based

2) contacts a web service API to store the "game data" (turns, user info, etc).

In my case, i'm using .NET MVC and a SQL Server backend to develop the API. We're not talking an immense amount of data here - small images will be transferred back and forth and stored in the database though. A typical request would see a few records added or changed in the database.

I mostly don't have much concept of when things would start to get overloaded - my concern, of course, is that this thing takes off (obviously wishful thinking) and then my server gets so overwhelmed that it dies. That being said, I don't want to spend time and money on Windows Azure or something when my hosting needs may be totally trivial.

So, my somewhat general question is this - does anyone have any firsthand knowledge of when things start to get overloaded? Like...just a general estimate of number of requests or something for a time period, assuming each request hits the .NET app which then hits the database a reasonable number of times.

Even some anecdotal "My similar API gets hit 10,000 times a minute and is hosted on crappy shared hosting" would be awesome just so I get some concept.

Thanks in advance!


Solution

  • It is very hard to give a good answer to your question as it greatly depends on what precisely the backend does for each request. Even "trivial" services as you describe can easily differ greatly in performance depending on the actual implementation.

    As a rough guideline based on our projects, if your API is a single HTTP request (no HTTPS), hitting a bare-bones controller, being translated into a single, simple SQL statement ("SELECT * FROM foo WHERE bar") returning less than 100 Bytes of data, you can serve about 750 requests per minute on a 32 Bit, 1 Gigahertz box with 512MB ram.

    But this number will be reduced to 75 or less if any of those factors go up.

    That said:

    This is the poster-child case for cloud computing. If Azure is too much hassle / cost for you (which is not an uncommon complaint from independent developers) you have three main alternatives:

    1) Ditch .NET in favor of Python and host within Google App Engine

    Python is quick to learn and GAE scales beautifully without you ever needing to care. Best of all, there is a huge free-tier so unless your app really takes off, you won't pay a cent. As you are developing for iOS, I assume you aren't hell bent on .NET to begin with.

    2) If you need .NET, go with AWS

    They also have a rather large free-tier. Either throw everything on top of a Mono stack (completely free for the 1st year) or shell out the money for a Windows EC2 instance. This takes more planning than GAE but with a little work you can make it scale to wherever your app goes.

    If cost is a concern, use the same AWS cluster to host several of your Apps' APIs.

    3) Go with OpenFeint's Multiplayer API

    OpenFeint supports basic multiplayer games. If you can implement the needed functionality using it, then this might be the best solution. If not, look into (1) and (2).