PHP XMPP 机器人性能

发布于 2024-10-08 02:37:51 字数 120 浏览 0 评论 0原文

嘿伙计们。我需要编写 xmpp 机器人,它将每小时(24/7 工作时间)接收和发送大约 2000 条消息,并使用 MongoDB(选择、更新查询)。把它写在 php 上是不是一个坏主意?如果我使用 php 5.3,性能怎么样?

Hey guys. I need to write xmpp bot which will be receiving and sending about 2000 messages per hour (24/7 work time) and working with MongoDB (select, update queries). Is it bad idea to write it on php? What about performance if i'll use php 5.3?

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

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

发布评论

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

评论(2

2024-10-15 02:37:51

我认为即使您的 xmpp 机器人 24x7 运行,每小时 2000 条消息也根本不会成为问题。我有 xmpp 机器人运行数周的经验,没有任何内存泄漏,并且在运行时有数百万次数据库写入。当然,您的数据库写入策略(动态或聚合写入)将对基于 php 的 xmpp 机器人使用的内存量产生影响。

I don't think 2000 messages per hour will be a problem at all even if your xmpp bot runs 24x7. I have experience with xmpp bots running for weeks without any memory leaks and millions of db writes during it's run time. Ofcourse your db write strategy (on the fly or aggregated write) will make an impact over amount of memory used by your php based xmpp bot.

奈何桥上唱咆哮 2024-10-15 02:37:51

几乎在所有涉及数据库的情况下,数据库开销都将主导脚本执行时间。
每 1.8 秒 1 个请求,使用 PHP 就可以了。

In almost every situation where a DB is involved, DB overhead is going to dominate script execution time.
With 1 request every 1.8 seconds, using PHP will be just fine.

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