I'm building a an application using sails and every time I leave the server running for more than a few minutes my CPU jumps to a solid 100% usage. I'm including a big amount of less files in my assets and I believe my issue lies here. Are there any other reasons this may happen?
相关问题
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- google-drive can't get push notifications
- How to reimport module with ES6 import
- Why is `node.js` dying when called from inside pyt
- How to verify laravel passport api token in node /
相关文章
- node连接远程oracle报错
- How can make folder with Firebase Cloud Functions
- @angular-cli install fails with deprecated request
- node.js modify file data stream?
- How to resolve hostname to an ip address in node j
- Transactionally writing files in Node.js
- Log to node console or debug during webpack build
- Get file created date in node
It could be the grunt-watch, when you have a lot of files it squeezes your cpu. Try disabling that and check if your cpu gets to a normal usage (6-30% depending on your cpu and overall usage).
To do that go to
tasks/register/default.js
and remove'watch'
from the array.If you don't want to completely disable the grunt watcher, then go to
tasks/config/watch.js
and try excluding the folder that has most of your files, or exclude them all if they are not in a particular folder.I'll give you an example of how to exclude a folder for this task. Just add a
!
before the path you want to exclude.I had a similar issue and this worked for me, let me know if it works.