Skip to main content

Turbo Mode and Connections Limit

How to speed up your bot at the time of a large influx of users and their simultaneous activity during advertising companies or periodic events in your bot. About «Turbo Mode» and Connection Limits in Telegram bots.

The performance of bots in Menu Builder is constantly maintained at the proper level, however, in order to keep the cost of services as low as it is and remain the most affordable bot constructor in Telegram, the load limits of an individual bot are estimated in a way to be used in the NORMAL (ROUTINE) MODE and there are also mechanisms to limit abuse.

If, when placing advertisements or any other similar case, when a large number of users come to the bot at the same time, you expect to receive temporary peak load indicators or you already feel delays in the bot's performance for the above reasons, activate the «Turbo Mode».

In «Turbo Mode» - your bot’s "Connection Limit" will be increased, which will instantly allow it to transfer more load to our server from Telegram servers.


Connection Limit


Connections limit - determines how many simultaneous requests the Telegram server can send to your bot. The higher this number, the more users will be able to use the bot per unit of time without feeling the bot's reaction slowdown.

In the most general case, pressing one button takes one connection. The active connection is closed when the assigned action is fully completed and a message with the result is sent back to the user.

The lifetime of one compound, on average, varies in FRACTIONS OF A second.

So 10 connections does NOT mean 10 concurrent (simultaneous) users.

Rather, it is a combination of factors:
• The number of concurrent users.
• The number of button presses for each of them.
• The frequency of pressing the buttons for each of them.
• The complexity of the actions that the bot needs to perform with each press and, accordingly, how long the button function will keep the connection open...

The above factors can be superimposed on each other, being combined in various combinations, both in terms of quantity and duration. This will ultimately determine the degree of overflow of the request queue on Telegram servers.
It should be understood that the mechanics of user interaction with a bot is such that 200 users may not perform even one single simultaneous action while using the bot at the same time... Therefore, a properly constructed bot with 100k users where active user actions are spaced in time can never feel a lack of connections, while a bot with a small number of subscribers, but all actions in which are concentrated on a short period, may experience an unexpected slowdown in reaction...


Request Queue


Request Queue - (Message Queue) shows the current number of requests to be sent to your bot, which has accumulated on the Telegram server at the moment when report message itself was generated.

Please note that on average, the lifespan of one request is tenths or hundredths of a second, therefore, firstly, even if there is a queue of 15-20-30 requests, there should not be any noticeable delay, and the numbers indicated in the message are just a snapshot of the state of the system at the time of generation the report message itself. Therefore it can rather give an idea of ​​the figures range at the current moment, rather than reflect a certain long-term state.

Obviously, there are exceptions to every rule. An example of an exception for this case could be Bonus Buttons. For this type of buttons, there was an artificial delay of one second, this was due to the principle by which the protection against multi-key presses was working - when the attacker tries to press the bonus button more often than is stipulated by button’s cool-down time.

Now this delay has been removed and the bonus button is protected by other mechanisms, but this example illustrates the principle better than anything else.

Thus, the need to press a large number of bonus buttons in the bot inevitably leads to the fact that the lifetime of one connection increases to 1 second. Such large delays can already lead to an overflow of the Queue even with not the highest user activity.

In simple words, all of the above means that, in the most general case, the «Number of connections» determines how many people can SIMULTANEOUSLY and ACTIVELY use the bot per unit of time.


SUMMARIZING: There is no direct correlation with the number of users in your bot and its performance. It matters how your interaction with them is organized, how many people SIMULTANEOUSLY and ACTIVELY use its functions.


Each bot is individual and it is impossible to give one recommendation for all. However, the following factors are having influence to the right «Number of connections» you may need at the moment:
• An active advertising campaign - when a large number of users come to the bot at the same time.
• The number and complexity of tasks performed in the bot immediately after the arrival of a new user (subscribing to a channel, for example).
• The number of messages and mailings that you carry out at this moment.
• The need for users to fill out feedback forms with storing data in variables.
• he presence of auto accruals to the balance of the users.

The more simultaneous active actions of a large number of subscribers, the greater the chance of slowdowns.


Turbo Mode


How to enable Turbo Mode

Turbo Mode - implemented to temporarily increase the Connection Limit in order to accelerate the work of your bot during peak situational loads. Allows you to transfer more load, per unit time, to the Menu Builder’s server from Telegram servers.

You can check the current state of Turbo Mode in:
☞ 🔐Admin

Turbo Mode is activated in your bot.

Turbo Mode.
To connect, go to your bot:
☞ 🔐Admin | 🧩Extensions | 🚀Turbo Mode

At the moment, the acceleration of your bot can be activated for
• 1 day
• 7 days
• 30 days
Select the desired duration and confirm the activation.


How to check the status of the request queue

You can check the status of the Queue and the current Connection Limit in the @MenuBuilderBot head bot.


By using the command

To do this, send a command to the head Bot (the command will work only for the admin):
/botstatus @your_bot_addres
Where:
@your_bot_addres - is the address of your bot in Telegram.


By using the head bot menu

Or go to the head bot @MenuBuilderBot:
☞ 🛠Manage Bots | 📋List of Menu-Bots
Select your bot and click: «Bot Status».


How to use it

If you feel delays in the bot or receiving user's complaints
1. Go to the head bot @MenuBuilderBot.
2. And with an interval of a few seconds (10-20) send the command:
/botstatus @your_bot_addres
3. If the queue is greater than 0 (zero) and starts to accumulate during the second check, then you can activate the «Turbo Mode». If it is zero or near zero, then everything is fine.

IF THE QUEUE DOESN'T GROW
• If the current queue is 2 times larger than the «Connections Limit» - then everything is fine, this is the standard operation of the bot. This condition does not affect performance in any way.
• If the current queue is 5 times larger than the «Connections Limit», this is also normal. This may add slight delays, but the bot is fine.


Emergency «Turbo Mode» activation

If, due to the increased load, your bot has stopped (or almost stopped) responding to button presses or commands, then it will be difficult for you to enable «Turbo Mode» in the regular way (through the bot's admin panel). For such cases, the head bot @MenuBuilderBot, in your bot management section, provides the ability to activate «Turbo Mode».

To enable the mode, go to the head bot @MenuBuilderBot:
☞ Manage Bots > List of Menu-Bots.
• Select the bot's name from the list.
• Press the inline button «Turbo Mode».
• Follow the standard feature acquisition process.

Despite the fact that activation occurs through the head bot - in case of a successful outcome, a confirmation message will come with the SAME BOT for which the mode was activated.

This will let you to enable «Turbo Mode» for 1 day.
The cost is standard.

IMPORTANT: To activate «Turbo Mode», after purchase, you must restart the bot in the same place - Manage Bot section.

If, for the load that your users create, «Turbo Mode» is not enough, you can transfer your bot to a Dedicated Server. Read about what a dedicated server is, who needs it and when, in the «Dedicated Server» manual.