Answer the question
In order to leave comments, you need to log in
How to properly handle Telegram Bot API requests?
Users write to the bot, the bot responds to requests by sending text from the database and a file via CurlFile .
Due to numerous requests to the bot handler at the same time, the bot stops responding to any requests, sometimes it is buggy.
I solved the problem as follows:
For each request I create a separate process in the console exec('php ./bot.php &> /dev/null &');
I'm afraid that the server will soon fall down from numerous console calls via exec ()
Is this true? Does this function have a big load?
If yes, how else can this problem be solved?
Answer the question
In order to leave comments, you need to log in
Strange problem.
See what starts to fail in the handler. If it is written by direct hands - everything should work fine.
Of course, you can also cut some kind of queue, but this is really useful only if you have some kind of wild peak highload, and a lot of resources are required for the answer.
UPD , just in case, I’ll clarify: you shouldn’t write bot handlers based on any heavy frameworks
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question