XMPP PHP bot 24/7


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
5 views
Hello. There is a need to write a jabber bot that will work around the clock, thus taking and sending about 2000 messages per hour and working with the database MongoDB.
The bot will work on Linux, but since I do not have sufficient knowledge of C/C++ (which is preferable for this task), I want to write it on PHP 5.3.
But with this kind of tasks are things with PHP? Will not have such a script low performance? Will it "eat" memory?
Thanks for the tip.
by | 5 views

7 Answers

0 like 0 dislike
At the time, tried to solve a similar problem. Nothing good ever came of it: the connection is permanently torn or hung. In principle, memory problems should not be. If they are, you can restart the script after a certain period of time, it's not scary.
\r
I would advise to learn one of the higher-level languages (e.g. Python or Ruby). To learn Ruby at the primary level is a matter of one day, and the problem it solved much easier.
by
0 like 0 dislike
python + twisted?
by
0 like 0 dislike
Spend a few days learning Python and write on it (you can, as mentioned, get Twisted). It would be much better both for you and for solving the problem.
by
0 like 0 dislike
Once wrote a Python + xmpppy:
\rwiki.linuxformat.ru/index.php/LXF121:Python
\rxmpppy.sourceforge.net/
by
0 like 0 dislike
Here http://steelbot.net you can find Jabber bot with plugins and other buns. The best option of those I've seen.
by
0 like 0 dislike
2000 per hour is an average of 1 message every 1.8 seconds, do you think that this is a serious load? Mrsny CLI daemon will quietly do it, the more that will be frisky NoSQL-storage.
by
0 like 0 dislike
Performance is quite enough for such loads, if the logic of the bot is simple, and not neural network for passing the Turing test :)
\r
To much to write from scratch suggest you look at phpdaemon On habré about it also wrote
by

Related questions

0 like 0 dislike
1 answer
asked Apr 9, 2019 by Egorian
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 21, 2019 by dmitrylee
110,608 questions
257,186 answers
0 comments
28,032 users