I have a single node.js app running on my shared web host. The cPanel shows 67/100 processes, and 7 entry processes.
The thing is, the site currently doesn’t do anything except letting users see it.
The number of processes when I first deployed the app a week ago was only 11/100. But it keeps rising gradually, for no apparent reason..
I was wondering if my code has any issue to be causing this.. It is fairly simple, but there may be something I do not see.
My entire project is hosted on github at https://github.com/ravindukrs/HackX-Jr-Web
===================
What I tried
I Stopped the app from cPanel. But number of processes didn’t go down. It slightly reduced the CPU Usage though.
Note
CPU Usage remains 0/100 even when the app is running.
I am not a great developer, so code may not be optimized. But was just wondering if I am creating any processes that do not end..
The site is currently hosted at https://hackxjr.lk
Thank you in advance.
Update: Count is still going up
4
Answers
Here is my experience with this same problem and how I resolved it.
I setup a simple NodeJs app on my Namecheap host and about a day later my whole domain was unavailable. I checked CPANEL and noticed 200/200 processes were running. So I contacted Support and they said this:
Here is the cron job they setup:
I have not had an issue since.
You can stop unused processes by run this command:
I also had the problem on Namecheap. Strange that it is always them…
Support told me it had to do with their CageFS and that it only can be fixed/reseted via support.
Edit:
support gave me a new cronjob to run
For me, this one is working better than the command from Gerardo.
I have encountered the exact same issue like you are describing. My hosting provider for NodeJS apps and PHP sites is Namecheap too. Strange that their name keeps popping up on this thread.
This is what Namecheap support said:
If you are using cPanel, this article might help you to setup a cron job: https://www.namecheap.com/support/knowledgebase/article.aspx/9453/29/how-to-run-scripts-via-cron-jobs/