服务器每秒可以处理多少个 MySql 查询?
我已经开始开发浏览器(数据库)游戏。我的问题是常规托管可以处理多少个查询(当我指的是常规托管时,我指的是您可以以大约 7 美元/月的价格找到的共享托管)。 至于查询,没有什么复杂的(简单的 SELECT 和 WHERE 操作)。
所以... ? 10? 100? 10000?
I've started developing a browser (database) game. My question is how many queries can a regular hosting handle (when I mean regular, I mean a shared hosting you cand find for about 7$/month).
As for the queries, nothing complicated (simple SELECT and WHERE operations).
So... ? 10? 100 ? 10000?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Yoshinori Matsunobu 他的一篇文章声称使用
SQL
每秒105,000
次查询,使用本机InnoDB
API
每秒750,000
次查询代码>.所有查询都是简单的
PK
查找。在共享主机上,这些数字当然会低得多。当然具体多少取决于共享主机。
Yoshinori Matsunobu in one of his articles claims
105,000
queries per second usingSQL
, and750,000
queries per second using nativeInnoDB
API
.All queries are simple
PK
lookups.On a shared hosting these numbers will of course be much lower. How much exactly of course depends on the shared hosting.
这完全取决于服务器硬件、它的缓存能力和配置,以及用于非易失性存储的硬件类型(例如,具有主轴或 SSD 的硬盘驱动器 RAID 阵列?),更不用说查询类型了和正在查询的数据库,包括:
如果不知道所有这些因素,就不可能估计性能。最佳估计来自实际分析,在正常操作条件下使用实际呈现的查询类型执行。
This is completely dependant on the server hardware, it's caching ability and configuration, and the type of hardware it uses for non-volatile storage (e.g., a RAID array of hard drives with spindles or SSDs?), not to mention the type of query and database being queried, including:
Without knowing all of these factors, it is impossible to estimate performance. The best estimate comes from actual profiling, performed under normal operating conditions with the type of queries that will actually be presented.
许多因素都会影响数据库的响应时间。硬件、应用程序配置(开箱即用的 mysql 性能不佳),最后但并非最不重要的一点是您的编码!
写得不好的查询会让应用程序感觉缓慢和迟缓。例如,在代码中使用 count(*)(对于一个非常简单的示例),或者在数据库上没有索引,将随着数据集的增长影响数据库响应时间。
Many factors can influence the response time of a database. Hardware, application configuration, (mysql out of the box does not perform all that well), and last but not least, your coding!
Badly written queries can bring make an app feel slow and sluggish. Using count(*) in your code, for a very trivial example, or having no indexes on the database, for example, will influence your db response time as your dataset grows.