I deployed my Flask backend on Render's free tier, shared the link with a friend to test, and got a message back: "bro it's not loading."
I checked it myself. It loaded — but after a painful 60 second wait. That's when I realized what was happening.
The Problem
Render's free tier spins down your service after 15 minutes of inactivity. So the first request after any idle period has to wait for the server to wake back up. Sometimes it's 30 seconds, sometimes a full minute. For anyone testing your project cold, it just looks broken.
I wasn't ready to pay for hosting yet — it was just a side project. So I started looking for a workaround.
First Idea: GitHub Actions
My first thought was to set up a cron job in GitHub Actions that pings my server every 14 minutes. Simple enough — just a curl to keep it awake.
But then I did the math. GitHub gives you 2,000 free Actions minutes per month. Pinging every 14 minutes adds up to roughly 3,000+ runs per month. That blows the free limit. Crossed that off.
What Actually Worked
The logic is straightforward — if something pings your server before the 15 minute timer runs out, it never sleeps. I just needed something to do that automatically, for free, without eating GitHub minutes.
I came across UptimeRobot. It's a monitoring tool that hits your URL every 5 minutes and notifies you if it goes down. The free plan does exactly what I needed.
But first I needed an endpoint worth pinging. I added a simple /health route to my Flask app:
@app.route('/health')
def health():
return {"status": "ok"}, 200
No logic, no database — just a response to prove the server is alive. Then in UptimeRobot, I created an HTTP monitor pointing to https://your-app.onrender.com/health with a 5 minute interval.
That's it. Server hasn't slept since.
One Thing I Was Worried About
I thought UptimeRobot would email me every 5 minutes. It doesn't. It pings silently — you only hear from it when your server actually goes down or comes back up. No noise at all during normal operation.
Why Not Just Pay?
Render's Starter plan is $7/month and removes the sleep behavior entirely. Honestly, for a real production app, that's the right call. But for a side project or something you're still building? This workaround costs nothing and takes about 10 minutes to set up.
If you've found a cleaner way to handle this, I'd love to hear it in the comments.
Top comments (0)