Home > other >  Node app running on cPanel hosting shuts down after 30 minutes idle
Node app running on cPanel hosting shuts down after 30 minutes idle

Time:11-13

I have a REST api node app. Once its running on localhost, it runs until I stop the dev debugging, no errors. I moved it over to my cPanel hosting, installed a node app. It starts up the same as localhost. But after 30 minutes being idle, it shuts down. The next request after this, restarts the app. There are no crash or errors in the log, just the restarting messages.

I know this is default behaviour for free hosting, like Heroku but I'm paying for this hosting package.

Does anyone know... Is this default behaviour for cPanel hosted node apps, or is my app causing this (using too much memory or cpu for example? Is there any settings that can be edited to change this?

CodePudding user response:

According to the docs, cPanel uses something called Phusion Passenger to run Node.js. In turn, Passenger docs show a default "idle time" of 5 minutes and a default of passenger_min_instances = 1. No idea if cPanel changes the defaults, or if the hosting provider did. I would recommend contacting the hosting provider about the issue in any case, and asking about these options specifically - they may be able to help or tune the service for you.

  • Related