5 months ago
I’m running a multi-account Telegram bot using Telethon on Railway. The bot works fine in general (commands, replies, and forwarding in one test group are functional), but I’ve noticed that it does not process messages reliably across all groups. On Heroku the exact same code was able to handle messages from every group without issues, but on Railway it seems slower and sometimes misses forwarding or replying in certain groups.
Observations
CPU usage is very low (<0.2 vCPU out of 2 vCPUs).
Memory usage is also very low (~60–80 MB out of 1 GB).
The service stays online and doesn’t crash, but message handling seems delayed or incomplete.
What is the problem?
2 Replies
5 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
5 months ago
On Railway you’re likely running without a persisted Telethon session/entity cache and with a single event loop doing blocking work. That makes events.NewMessage(chats=…) filters fail to match some groups and delays handling. Persist the session, pre‑resolve chat IDs, make handlers non‑blocking, and tune reconnect/keepalives.