a month ago
Hi,
My service watchlist (project: balanced-spirit) is not going to sleep despite being configured as serverless.
I can see in the Network Flow Logs that MongoDB Atlas is sending heartbeat connections every ~3 minutes to my service, which seems to prevent it from sleeping.
My other project job-tracker with PostgreSQL sleeps normally.
Is there a way to make the service sleep despite incoming MongoDB heartbeat connections?
Thank you.
1 Replies
a month ago
Serverless sleep is triggered when no outbound packets are detected for 10 minutes. An active MongoDB connection pool causes your service to send outbound keepalive packets to MongoDB Atlas, which prevents sleep. As noted in our serverless docs, keeping active database connections open (such as a connection pooler) is a known cause of this. Your job-tracker service with PostgreSQL likely closes its connections when idle, which is why it sleeps normally. To allow sleeping, your application would need to close or not maintain persistent MongoDB connections when idle.
Status changed to Awaiting User Response Railway • about 1 month ago
Status changed to Solved op7en • about 1 month ago