grammyjs / runner

Scale bots that use long polling to receive updates.
https://grammy.dev/plugins/runner
MIT License
18 stars 2 forks source link

Update README.md #19

Closed thevolcanomanishere closed 11 months ago

thevolcanomanishere commented 11 months ago

The "do I need this?" section says 1k requests per hour is enough to start using this repo. It should be 1k/second

From the documentation: Screenshot 2023-10-05 at 20 06 12

KnorpelSenf commented 11 months ago

You seem to have misunderstood.

< 1000 per hour: built-in polling
> 1000 per hour and < 1000 per second: grammY runner
> 1000 per second: grammY runner with multitasking (bot workers)

Thanks for the initiative to fix up the docs directly, though, we need more people with this level of engagement 🎉

thevolcanomanishere commented 11 months ago

@KnorpelSenf The included screenshot in my original is not what I was PRing about. I am referring to the README of this repo. Grammy runner is not needed for just 1k reqs per hour.

Screenshot 2023-10-25 at 11 34 53

KnorpelSenf commented 11 months ago

Grammy runner is not needed for just 1k reqs per hour

1K req/h means roughly one message every 3 seconds. Middleware can sometimes take an entire second to complete, especially if the Bot API server slows down requests due to rate limits. Some bots have a periodic 15-fold load change in the course of each day, depending on the timezones of their user base. This means that bots with an average 1K req/hour can easily receive 3 messages per second. In fact, in some minutes, there can be load spikes with high activity, resulting in 10-20 messages per second.

The built-in polling processes updates in sequence. In total, this means that 1K req/hour can lead to several seconds of wait time for users. It makes a lot of sense to use grammY runner for such bots.

Perhaps one can argue that 2-3K req/h are still acceptable guidelines, but I want to keep the numbers very simple. 1K req/h is the order of magnitude to remember.