My telegram bot is too slow

alimardanovPRO

5 months ago

From time to time my telegram bot deployed on railways is bery slow. Right now it sloow too. My users are suffering. I am on pro plan. I have two exactly same bots deployed on railway. One has few users, the second has more. The second one with higher user count is freezing. What can I do?

0 Replies

alimardanovPRO

5 months ago

@Brody please, help


5 months ago

theres really not much we can do for you here at the platform level, your code is suffering from increased load


alimardanovPRO

5 months ago

I understand. Yesterday, I had the same amount of load. but today it is freezing.


5 months ago

guess you have a little bit more load today


5 months ago

are you using webhooks? as long as you are, maybe you could add replicas?


alimardanovPRO

5 months ago

I am using aiogram 3. I think it uses webhooks


maddsuaHOBBY

5 months ago

There could be many causes to that. For example, the application itself could be doing a lot of slow operations, like making external requests sequentially, not using batching etc.


5 months ago

also, for future reference, friendly reminder - <#727685388893945877> #5


maddsuaHOBBY

5 months ago

Also, if it uses polling with a timeout instead of webhooks, well, that will have a delay equal to the polling interval


maddsuaHOBBY

5 months ago

Does it use any significant amount of resources? If not, there's a huge chance that it's either not using webhooks or doesn't use parallel requests


maddsuaHOBBY

5 months ago

You should be able to use the WebhookInfo method, described in the Telegram Bot API, to get current webhook status


alimardanovPRO

5 months ago

It turns out my bot doesn't use webhooks. I try to convert


alimardanovPRO

5 months ago

Thanks for the help1


My telegram bot is too slow - Railway Help Station