run backup uploader with a nice of 15
the gzip takes a lot of cpu processing and hogs the CPU. With a nice level, we give other things higher priority. An alternate idea that was explored was to use cpulimit. This is to send SIGSTOP and SIGCONT periodically but this will not make use of the CPU if it's idle (unlike nice). Another idea is to use cgroups, but it's not clear how to use it with the dynamic setup we have. part of #691
This commit is contained in:
+1
-1
@@ -856,7 +856,7 @@ function runBackupUpload(uploadConfig, progressCallback, callback) {
|
||||
|
||||
let result = ''; // the script communicates error result as a string
|
||||
|
||||
shell.sudo(`backup-${backupId}`, [ BACKUP_UPLOAD_CMD, backupId, format, dataLayout.toString() ], { preserveEnv: true, ipc: true }, function (error) {
|
||||
shell.sudo(`backup-${backupId}`, [ BACKUP_UPLOAD_CMD, backupId, format, dataLayout.toString() ], { preserveEnv: true, ipc: true, nice: 15 }, function (error) {
|
||||
if (error && (error.code === null /* signal */ || (error.code !== 0 && error.code !== 50))) { // backuptask crashed
|
||||
return callback(new BoxError(BoxError.INTERNAL_ERROR, 'Backuptask crashed'));
|
||||
} else if (error && error.code === 50) { // exited with error
|
||||
|
||||
Reference in New Issue
Block a user