Jump to content

[Solved] The Memory and CPU usage is extremely high


ltseng

Recommended Posts

The Account Load always shows that the memory and CPU usage are very high,but I have stopped the node service and did not run other applications. I think it is a bug. Please help me solve it. You can reset my host if necessary. Thank you.

Link to comment
Share on other sites

Node really uses that many resources, and it's the second leading cause of suspension behind Wordpress. It is extremely inefficient.

It is worth noting that if you noticed a spike specifically in the memory numbers in the past day or so for a program that has worked previously, the memory calculations were recently updated to more accurately reflect memory usage. This was the result of a user who managed to almost crash the server, and the new calculations will reflect as an increase in memory usage for users with long-running programs like Node and Python. PHP users are less likely to be affected by the changes because PHP both exits after each page is loaded, and times out after a minute or so if it doesn't finish.

Link to comment
Share on other sites

1 hour ago, wolstech said:

Node really uses that many resources, and it's the second leading cause of suspension behind Wordpress. It is extremely inefficient.

It is worth noting that if you noticed a spike specifically in the memory numbers in the past day or so for a program that has worked previously, the memory calculations were recently updated to more accurately reflect memory usage. This was the result of a user who managed to almost crash the server, and the new calculations will reflect as an increase in memory usage for users with long-running programs like Node and Python. PHP users are less likely to be affected by the changes because PHP both exits after each page is loaded, and times out after a minute or so if it doesn't finish.

image.png.4e45d95195972b4b4f72b3b2fbdd085b.png

It has been restored now, but as you can see from the picture, after I found that the usage was high and disabled the app, the peak still lasted for seven or eight hours. Isn't this a bit strange?

Link to comment
Share on other sites

It looks like you started these two processes

npm run start
node index.js

and they were running up until 2 hours ago. When you start processes that never exit they ... never exit. If you want to run a Node.js website we strongly recommend following the guide that we wrote https://wiki.helionet.org/tutorials/node.js It uses Passenger which means if you don't get any page hits for 5-10 minutes your Node.js processes are killed and when someone views your website again they are started again. Unless you are getting constant visitors to your website every few minutes it will save you massive amounts of memory usage. If you follow some random Node.js guide on the internet they will most likely tell you to run a command like the above that never exits, and you will most likely end up suspended.

If you didn't run the above commands then you should change your password because someone else has access to your account.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...