Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
大家好。我需要编写 xmpp bot,它将每小时接收和发送大约 2000 条消息(24/7 工作时间)并使用 MongoDB(选择、更新查询)。在php上写它是个坏主意吗?如果我使用 php 5.3,性能如何?
即使您的 xmpp 机器人 24x7 运行,我认为每小时 2000 条消息根本不是问题。我有 xmpp 机器人运行数周的经验,在运行期间没有任何内存泄漏和数百万次数据库写入。当然,您的数据库写入策略(即时或聚合写入)将对基于 php 的 xmpp 机器人使用的内存量产生影响。
在几乎所有涉及数据库的情况下,数据库开销都将支配脚本执行时间。每 1.8 秒有 1 个请求,使用 PHP 就可以了。