High Response Latency in Telegram Bot Deployed on Railway
hyperforge01-hub
HOBBYOP

3 months ago

Hello Railway Team,

I’ve deployed a Telegram bot (PropHub) on Railway, and I’m experiencing significant response delays when users interact with the bot on Telegram.

Issue details:

  • Bot receives messages instantly (Telegram side is fine)

  • Responses are delayed by several seconds to sometimes minutes

  • This happens even for simple button interactions and lightweight API calls

  • The issue is consistent, not a one-off spike

Current setup:

  • Deployed on Railway (always-on service)

  • Telegram Bot API webhook-based integration

  • Node.js backend (lightweight request handling)

  • No heavy background jobs running during interaction

  • Database + external APIs are minimal and async

Why this is critical:
This is a production-facing conversational bot where UX depends heavily on real-time replies. Delayed responses severely impact user trust and usability.

What I’d like help with:

  1. Whether this could be related to:

    • Cold starts / container sleep

    • CPU throttling or memory limits

    • Region or networking latency

  2. Any recommended configuration changes to:

    • Keep the service warm

    • Reduce webhook response time

    • Improve Telegram webhook performance on Railway

  3. Logs or metrics I can check on my end to diagnose this further

If needed, I can share:

  • Project ID

  • Deployment logs

  • Sample timestamps showing message received vs response sent

Looking forward to your guidance on resolving this.

Thanks,
Mayur Sondagar
Developer – PropHub

Solved

2 Replies

3 months ago

By default your services won't go to sleep and are always on. There is mode called Serverless in your service settings that will spin down your containers when there's no traffic and spin them back up once more traffic comes in, so make sure that's off.

Are the latency spikes happening frequently or just every so often?


echohack
EMPLOYEE

3 months ago

Hey there!

I'm not seeing any glaring issues from the Railway side of things. Can you link directly to the deployment that seems to be having increased latency?


Status changed to Awaiting User Response Railway 3 months ago


Railway
BOT

3 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 3 months ago


Loading...