Web service stops responding

Hello,
I recently found out about render and decided to give it a try, I managed to deploy a free tier web service - an express server that serves react build files (MERN)

if (process.env.PROD==="true") {
    //Set static folder up in production
    app.use(express.static('../client/build'))
    app.get('*', (req,res) => res.sendFile(path.resolve(__dirname,'..', 'client', 'build','index.html')))
}

Currently the server connects to MongoDB atlas to do CRUD operations, and there’s an option for users to upload files to the server (I know that the disk storage on the server is ephemeral for the free plan), and it works completely fine, I am able to do everything without error, except that after a few minutes the website just stops responding as if the server crashed.
I checked the events and logs, but there’s nothing indicating that the express server failed. I am aware that on the free tier, after 15 minutes of inactivity the server spools down, but it seems like it spools down even before that amount of time.

I’m not sure if it’s something that I am doing wrong (I’m pretty new to this), or there’s some fine print in render’s free plan limit that I haven’t read.

If there’s any more information that I could share, i’ll gladly do it.

2 Likes

Confirm +1
Also having the issue If I access the service a few minutes before it’s scheduled to go cold. Redeploy fixes it until it happens again and it hangs indefinitely on the request. Interestingly I’m also using MongoDB (connecting to MongoDB Atlas free tier) but using Kotlin and Http4K as a web framework.

If I had to guess this is an automatic thing to stop people from preventing service sleep. If that’s the case it would be nice to have it documented somewhere.

1 Like

Same Issue for me, though with next.js and postgres sql. I’m on the free plan. If paid helps thats fine for me but this seems like unexpected and not intended behaviour.

Cheers
Timur

There is this thing that free plans are suspended after 15min of inactivity but as i understand it, its supposed to come back up on request taking 30s…

This feels like a very odd behaviour. Free plans are put to sleep after 15 minutes of inactivity. If you can share a service that exhibits this and steps that we could perform to duplicate this behaviour then we can take a look,

Regards,

John B

+1 to this issue. I have a backend server through Socket IO that completely stops responding to my (React) frontend webpage’s requests to connect after the aforementioned 15 minutes of inactivity.

My dashboard link to backend.

My dashboard link to frontend.

Same for me, the server just stops working and never comes back :frowning:

It worked for a couple of days though without problems.

I also notices that usage hours declined over time, but it doesn’t make sense, since I have cron job which wakes up the server every 10 minutes.

1 Like

Same for me. Both my docker web services don’ work. They were working fine for two days and they stopped working at December 3. If I redeploy, they work for a couple of minutes and then , nothing…
I also provide health check links which are supposed to get called by render every some secs.

1 Like

I figured it out, finally saw an unhandled exception in the logs, the web service stopped because of that.

I used

const fs = require('fs')
const { promisify } = require('util')
const unlinkAsync = promisify(fs.unlink)

and then inside an express api I used unlinkAsync("path_to_file") to remove some files that were uploaded to the server, that’s what made express throw an unhandled exception - I’m guessing it’s a free plan limitation or an OS limitation.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.