VPS for a Telegram bot: what plan is needed and what the load depends on

VPS for a Telegram bot: what plan is needed and what the load depends on

For a Telegram bot, it is worth choosing VPS/VDS not by the number of subscribers, but by what happens after each message. A bot with 20 thousand users may hardly load the server if it only shows prepared responses. At the same time, a small store with a few hundred active customers can hit the limits of the processor, memory, or database during promotions and mailings.

There is no universal "tariff for a bot." Resources are affected by the programming language and framework, the method of receiving updates, the number of simultaneous requests, file handling, external integrations, and background tasks. A buffer is also needed: a server that uses almost all its RAM on a regular day is not ready for peak loads.

From an informational bot to an artificial intelligence service

A practical starter tariff can be assessed based on the work scenario:

  1. Simple informational bot. Menus, commands, responses to frequently asked questions, issuing links or files do not require extensive configuration. For a single process of the bot, web server, and a small SQLite database, usually 1–2 vCPU, 2 GB RAM, and 20-35 GB on disk are sufficient. This is enough for code, logs, and system packages.

  2. Telegram store. Here, a catalog, cart, orders, payments, stock, product photos, and synchronization with CRM or website appear. The load is created not by the "Buy" button, but by the chain of operations after clicking. A smart minimum would be 2-3 vCPU, 4 GB RAM, and a fast NVMe disk. For a large catalog and regular product imports, it's better to provide 6 GB RAM.

  3. Support service bot. It needs a history of dialogues, distribution of requests among operators, attachments, notifications, and integration with a helpdesk system. For a small flow, 4 GB RAM is sufficient, but parallel operation of the web panel, PostgreSQL, Redis, and several handlers quickly increases memory consumption. For a round-the-clock service, 3-4 vCPU and 4-6 GB RAM are appropriate.

  4. Bot with a database or AI. If it stores profiles, chat history, search results, and analytics, the main factors become disk speed, query optimization, and caching. For working with an external API of a language model, a graphics card on the VPS is not needed: the server prepares the request, stores the context, and returns the response. You can start with 4-6 GB RAM. Local model launches often require a GPU server, significantly more memory, and separate computation.

Read also: OpenVZ, Xen, and KVM — comparing popular virtualization technologies

In the VPS-UP lineup, the KVM-35 configuration has 2 vCPU, 2 GB RAM, and 35 GB NVMe, KVM-75 — 3 vCPU and 4 GB RAM, and KVM-100 — 4 vCPU and 6 GB RAM. The first tariff is suitable for a simple bot, the second for a medium-scale store or support, and the third for a project with a database, cache, queues, and several workflows.

If the bot processes thousands of simultaneous requests, works with a large database, runs local AI models, or performs resource-intensive file operations, the capabilities of the VPS may eventually be insufficient. In this case, it is worth considering a dedicated server, where the processor, RAM, and disks are not shared among several clients. This provides more stable performance under prolonged load and allows for a more precise configuration, including a server with a large amount of RAM, several NVMe disks, or a graphics accelerator.

Why the number of users does not reflect the actual load

Telegram allows receiving updates in two mutually exclusive ways: through long polling using the getUpdates method or via webhook. Updates that the bot has not retrieved are stored on Telegram's side for no longer than 24 hours. For webhooks, you can set from 1 to 100 simultaneous HTTPS connections: a higher value increases throughput but creates higher parallel pressure on the application.

Long polling works well in small projects and during development. For a store, support, or service with uneven request flow, webhooks are usually more convenient. However, it does not eliminate peaks. If requests to the database, document generation, payment verification, and calls to external APIs are triggered after a message, these operations should be queued rather than executed in a single process.

The capabilities of the server should also not be confused with Telegram's limits. Official recommendations advise not to send more than one message per second to one chat, for groups there is a limit of about 20 messages per minute, and free mass mailing is limited to about 30 messages per second. Paid mailings can raise the limit to 1000 messages per second, but are available under certain conditions. 

Read also: Virtual servers in development: how to make life easier for programmers

A more powerful VPS will not bypass these limitations, but it will help to form a queue, repeat requests after a 429 error, and not block regular responses during mailings.

When choosing a tariff, it is worth evaluating the peak number of messages per minute, the average request processing time, the size of the database, and the number of background processes. After launch, monitoring of CPU, RAM, swap, disk operations, and response time is needed. If memory consistently stays above 75-80%, and the queue grows faster than it is processed, the configuration should be increased. For most bots, moving from 2 to 4 or 6 GB RAM is a simple first step, but poor database queries or synchronous processing of heavy operations will not disappear after switching to a more expensive tariff.

Автор

Рівтін Максим

Власник бізнесу, розробник, системний адміністратор.