If your background worker on Replit went silent overnight, you are not dealing with a mysterious bug in your code. You are experiencing how Replit handles compute lifecycle.
At 365Finds, we see developers repeatedly fall into the same trap: you write a Python loop or a Node.js daemon, run it inside an Autoscale deployment, and watch it die fifteen minutes after you close your browser. It feels like an outage. It is actually standard platform architecture working as designed.
To fix it, you need to understand why Replit puts workloads to sleep, why common workarounds fail, and when a Reserved VM is genuinely worth the money.
The Sleep Trigger: Autoscale vs Ingress Traffic
When you deploy an application on Replit using the default Autoscale setting, the infrastructure is purely request-driven. Replit provisions containers on top of Google Cloud Platform (GCP) and sits an ingress routing layer in front of them.
Here is the exact mechanism that causes your background jobs to sleep:
- Ingress Monitoring, Not Process Monitoring: Replit’s autoscale controller only monitors incoming HTTP requests routed to your
*.replit.appdomain. It does not monitor internal CPU activity, thread pools, or open background event loops. - The 15-Minute Idle Window: When no incoming HTTP request hits your deployed application for approximately 15 minutes, Replit triggers an idle scale-down.
- Scale-to-Zero Termination: Replit scales the instance count from one to zero. This is not a low-power pause. The container is halted and decommissioned.
The consequences for background jobs are immediate and fatal:
- In-Memory Loops Terminate: Any
setInterval(), Pythonwhile True, orasynciotask simply ceases to exist. - WebSocket and Bot Connections Drop: Long-polling or persistent WebSocket connections (such as Discord bots or Telegram polling scripts) do not register as inbound HTTP web requests to Replit's ingress router. Replit sees zero inbound traffic, assumes the app is idle, and terminates the container. Your bot shows as offline.
- Internal Schedulers Miss Execution: Libraries like
node-cronorAPSchedulerstop ticking because the virtual clock halts with the container. - Cold Starts and Memory Loss: When an external HTTP request eventually arrives, Replit spins up a fresh container. The initialization incurs cold-start latency (often 2 to 6 seconds), and any state held in process memory is permanently lost.
Many developers also confuse the development Workspace with production deployments. If you hit the green "Run" button in the Replit editor, that repl is meant for development. Once you close the tab, the workspace repl will suspend after an inactivity timeout. Replit deprecated legacy workspace "Always-On" switches; continuous execution now belongs strictly to the Deployments panel.
The External Ping Illusion
When developers discover that idle containers sleep, the immediate reflex is to set up a pinging service. Tools like UptimeRobot, cron-job.org, or a custom script are configured to send an HTTP GET request to https://yourapp.replit.app/ping every five minutes.
At 365Finds, our direct advice is simple: do not build production background workflows around ping services.
It is a fragile crutch. If the ping service encounters network latency, drops an interval, or Replit's ingress rotates edge routes, your container spins down anyway. Worse, stateful background workers—such as workers draining a task queue or holding open socket connections—will suffer abrupt session resets whenever Replit recycles the container. You trade architectural stability for the illusion of continuous uptime.
How Reserved VMs Change the Equation
The direct architectural solution to sleep behavior is deploying your repl to a Reserved VM.
Unlike Autoscale, a Reserved VM provisions a persistent server instance that runs 24 hours a day, 7 days a week, 365 days a year. It never scales to zero.
What Reserved VMs Do to Uptime
- Zero Sleep, Continuous Process Life: The virtual machine instance stays permanently active. Python daemons, Node.js background event loops, and continuous workers execute without interruption.
- Persistent Outbound Connections: Discord, Telegram, Slack, and database WebSocket connections remain continuously established.
- Elimination of Cold Starts: Because the container is already warm and running, incoming webhooks and API calls respond instantly with no container spin-up delays.
- Precise In-Code Scheduling: Internal cron jobs and background schedulers fire reliably at their designated timestamps because the system clock and threads never freeze.
Specs and Pricing Expectations
Replit structures Reserved VM pricing as a fixed baseline cost, billed on an hourly consumption basis (which deducts directly from your account credits or Replit Core allowance):
| Configuration | Compute Resources | Approximate Monthly Cost | Best For |
|---|---|---|---|
| Shared VM | 0.5 vCPU; 2 GiB RAM | ~$15 / month | Lightweight Discord/Telegram bots; small webhook receivers |
| Dedicated VM (Medium) | 1 vCPU; 4 GiB RAM | ~$35 / month | Medium worker daemons; multi-threaded data pipelines |
| Dedicated VM (Large) | 2 vCPU; 8 GiB RAM | ~$50 / month | High-throughput data syncing; memory-intensive task processing |
| Dedicated VM (Heavy) | 4 vCPU; 16 GiB RAM | ~$130 / month | Heavy backend computation; enterprise-grade persistent microservices |
The 365Finds Decision Framework: Reserved VM vs Scheduled Deployment
A common mistake 365Finds observes is throwing a Reserved VM at every background task. That is wasteful.
Replit provides multiple deployment models for a reason. Before choosing a Reserved VM, identify whether your workload is continuous or periodic:
- Continuous Workers and Bots -> Reserved VM: If your application requires an unbroken connection (a Discord bot, a live market data streamer, a real-time event consumer), a Reserved VM is mandatory. You cannot run continuous listeners reliably on Autoscale.
- Periodic and Batch Tasks -> Scheduled Deployments: If your background job is a script that executes once an hour, once a day, or once a week (such as daily database cleanups, nightly reporting, or periodic scraping), do not pay $15 to $50 a month for an idle Reserved VM running
time.sleep(). Use Replit Scheduled Deployments. A Scheduled Deployment spins up an ephemeral container on your cron schedule, runs the task, terminates the container, and charges you strictly by the second for active runtime. - Lightweight Webhooks with Storage -> Autoscale: If your background work is triggered by incoming HTTP webhooks, and your handler quickly writes payloads to an external database (such as Replit Postgres or an external store) before returning a response, Autoscale is adequate—provided you can tolerate cold-start response latency.
Realities Reserved VMs Cannot Fix
A Reserved VM guarantees compute persistence, but it does not guarantee bad code will stay running.
365Finds emphasizes two operational realities:
First, a Reserved VM is a single-instance deployment. If your script hits an unhandled exception or exhausts memory (OOM), the process crashes. Replit will restart the VM container, but any state stored strictly in RAM will disappear. You must pair a Reserved VM with structured error handling and persist important queue state to disk or a database.
Second, underlying cloud infrastructure occasionally requires maintenance. Host restarts and hypervisor migrations on GCP will cause brief, momentary blips. A Reserved VM provides steady 99.9% application uptime, but it is not a multi-region distributed cluster.
If your job requires unbroken listener uptime, select Reserved VM in the Replit Publishing tab, match your vCPU and memory to your process footprint, and leave the ping services behind.