使用非专用网络托管 PHP/MYSQL 数据库作为 iPhone 游戏后端

发布于 2024-10-14 04:35:36 字数 357 浏览 5 评论 0原文

我现在正在完成一款 iPhone 游戏的开发,该游戏使用 PHP/MYSQL 数据库中的数据。我目前(预发布)将所有数据托管在非专用网络托管服务上,但我不知道游戏上线后将如何扩展。我有点担心如果这款游戏还算流行的话它会崩溃。

游戏不会提取大量数据。一般用户每分钟会 ping 数据库 3-4 次,只是为了获取少量数据(一些文本字符串)。只要几个人使用它,一切都可以正常工作,但我对 MYSQL 的了解还不够深入,不知道它将如何扩展到潜在的数百个同时连接。

我对将其转移到专用服务器持怀疑态度,因为它们太贵了,而且我不知道游戏是否会一开始就崩溃,或者是否需要专用服务器。

有什么建议吗?如果我在这里所说的任何事情都是愚蠢的,我很抱歉。这不是我的专业领域。

I'm wrapping up development on an iPhone game right now that uses data from a PHP/MYSQL database. I'm currently (pre-release) hosting all the data on a non-dedicated web hosting service, but I have no idea how that will scale once the game goes live. I'm a bit worried it will crumble to it's knees if the game is moderately popular.

The game doesn't pull in a lot of data. The average user will ping the database 3-4 times a minute just to grab a tiny amount of data (a few text strings). Everything works fine with just a couple people using it, but I don't understand MYSQL well enough to know how it will scale to potentially hundreds of simultaneous connections.

I'm skeptical to move it to a dedicated server because they're damn expensive and I have no idea if the game will tank out of the gate or if it even needs a dedicated server.

Any advice? And sorry if anything I've said here is just plain stupid. This isn't my area of expertise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅此而已 2024-10-21 04:35:36

对于任何像这样的实际应用程序,我都会远离共享托管。专用服务器价格昂贵,但您可以从虚拟专用服务器获得可靠且相对便宜的服务。我使用 linode.com 的 VPS 来完成我的所有开发工作,基本计划每月费用为 20 美元,如果需要,您可以非常快速地升级您的计划(只需几分钟)。

I would stay away from shared hosting for any real application like this. Dedicated servers are expensive, but you can get reliable and relatively inexpensive service from a virtual private server. I use a VPS from linode.com for all my dev work, the basic plan costs $20 a month and you can upgrade your plan very quickly (matter of minutes) if needed.

终难遇 2024-10-21 04:35:36

首先对其进行负载测试!

您没有说明如何将数据从 MySQL 数据库提取到 iPhone,因此我假设它以某种形式使用 HTTP 请求。这意味着您可以使用负载测试工具,例如 Apache 的基准测试工具 ab,向服务器端应用程序生成许多并发请求,并查看它是否可以处理负载。

如果应用程序只是读取少量数据并且您已经正确地为表建立了索引,那么您可能没问题。但是,正如其他人指出的那样,VPS 可能是您最好的选择。

Load test it first!

You didn't indicate how the data is pulled from the MySQL database to the iPhones, so I am going to assume that it's using HTTP requests in some form. This means you can use a load testing tool, such as Apache's Benchmarking tool ab, to generate many concurrent requests to your server-side application and see if it handles the load.

If the application is just reading small amounts of data and you have indexed your tables properly you may be fine. But, as others have noted, a VPS is probably your best bet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文