Core: performance of callbackquery

Created on 7 Oct 2017  路  7Comments  路  Source: php-telegram-bot/core

Required Information

  • Operating system:
    PHP version: 7.0.22 (64bit); fpm-fcgi; Linux
    Maximum PHP script execution time: 3000 seconds
    MySQL version: 5.5.31
    Operating System: Linux x86_64
    Web Server: nginx/1.13.3
    curl version: 7.55.0; OpenSSL/1.0.1e
  • Using MySQL database: yes
  • Update Method: Webhook
  • Self-signed certificate: no

Expected behaviour

when user click on like button instance must get result.

Actual behaviour

after 2-5 second when users increase get result so slowly . for simple insert into db.

Steps to reproduce

how i can increase performance of my bot.

Most helpful comment

@wp-src Incorrect, it prevents getting blocked by Telegram API by limiting OUTGOING requests only.
https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this

All 7 comments

Hi, I have some suggestions for you.
First move your code to another server if is possible for you and check the performance.
Also you can make a very simple callback to see if the results are the same or not,
Another workaround is that you can make a simple bot without using this library to make sure the problem is not from your server.

simple callback have no problem with this library but when i update message with Request::editMessageCaption bot hang and server load under 1%.

i solved this issue with checking last update time of message and where last time greater than 5 second updating message and activating opcache.

Have you activated request limiter ?

//Enable requests limiter, to prevent attack like requests
$telegram->enableLimiter();

no i disabled it .

Then enable it, it prevents duplicate requests being processed by library.

@wp-src Incorrect, it prevents getting blocked by Telegram API by limiting OUTGOING requests only.
https://core.telegram.org/bots/faq#my-bot-is-hitting-limits-how-do-i-avoid-this

Was this page helpful?
0 / 5 - 0 ratings