Hello World Master

Tutorials, articles and quizzes on Software Development

A2Hosting > Articles

How to stop node processes in a2 hosting shared hosting service by creating a chron-job

Sometimes you may want to transpile es6 or Javascript to es5 or you might want to run unit tests using npm build scripts. Either way, there may be an npm script that you ran resulted in a node process that is taking up all your resources. And right now your number of processes might look like this:

Note the high number of processes on the right

You might also notice that you cant see any of your other a2 hosting web applications. It might look like this:

If you ran a node.js process through an npm script that doesn’t stop. Heres how you can stop it:

Step 1: Scroll down to the advance section and select Cron Jobs

Step 2: Scroll down to common settings click the dropdown and select Once Per Minute(* * * *)

Step 3: In the text box that says command type killall node this will kill all running node processes which will in turn free up your resources.

Step 4: Select the orange button that says Add New Chron Job. You see see your chron job added in Current Chron Jobs

Step 5: Wait about 1 minute for the command to run

After a minute, you should see that all your processes are no longer being used up and you can see your web applications as you did before.