node.js - Sails js application driving CPU usage to 100% -
i'm building application using sails , every time leave server running more few minutes cpu jumps solid 100% usage. i'm including big amount of less files in assets , believe issue lies here. there other reasons may happen?
it grunt-watch, when have lot of files squeezes cpu. try disabling , check if cpu gets normal usage (6-30% depending on cpu , overall usage).
to go tasks/register/default.js
, remove 'watch'
array.
module.exports = function (grunt) { grunt.registertask('default', ['compileassets', 'linkassets', 'watch']); };
if don't want disable grunt watcher, go tasks/config/watch.js
, try excluding folder has of files, or exclude them if not in particular folder.
i'll give example of how exclude folder task. add !
before path want exclude.
module.exports = function(grunt) { grunt.config.set('watch', { // config can ignore in case assets: { // assets watch: files: ['assets/**/*', 'tasks/pipeline.js', '!**/node_modules/**', '!assets/folder-to-exlude/**' // <-- here excluded path ], // more code } }); grunt.loadnpmtasks('grunt-contrib-watch'); };
i had similar issue , worked me, let me know if works.
Comments
Post a Comment