diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2021-01-10 21:02:55 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2021-01-13 09:16:44 +0100 |
commit | 7abb6060a91588fe21cad0f59f38941da728511c (patch) | |
tree | 29965087b75e115ecfde6bdd83a7485da25ea545 | |
parent | d8b34ee55b654912f86bb8b472d391ced8c28f64 (diff) | |
download | PeerTube-7abb6060a91588fe21cad0f59f38941da728511c.tar.gz PeerTube-7abb6060a91588fe21cad0f59f38941da728511c.tar.zst PeerTube-7abb6060a91588fe21cad0f59f38941da728511c.zip |
specific niceness for live transcoding
-rw-r--r-- | server/helpers/ffmpeg-utils.ts | 5 | ||||
-rw-r--r-- | server/initializers/constants.ts | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/server/helpers/ffmpeg-utils.ts b/server/helpers/ffmpeg-utils.ts index 1f5e8d8f6..d01e6f80e 100644 --- a/server/helpers/ffmpeg-utils.ts +++ b/server/helpers/ffmpeg-utils.ts | |||
@@ -594,7 +594,10 @@ function presetOnlyAudio (command: ffmpeg.FfmpegCommand): ffmpeg.FfmpegCommand { | |||
594 | 594 | ||
595 | function getFFmpeg (input: string, type: 'live' | 'vod') { | 595 | function getFFmpeg (input: string, type: 'live' | 'vod') { |
596 | // We set cwd explicitly because ffmpeg appears to create temporary files when trancoding which fails in read-only file systems | 596 | // We set cwd explicitly because ffmpeg appears to create temporary files when trancoding which fails in read-only file systems |
597 | const command = ffmpeg(input, { niceness: FFMPEG_NICE.TRANSCODING, cwd: CONFIG.STORAGE.TMP_DIR }) | 597 | const command = ffmpeg(input, { |
598 | niceness: type === 'live' ? FFMPEG_NICE.LIVE : FFMPEG_NICE.VOD, | ||
599 | cwd: CONFIG.STORAGE.TMP_DIR | ||
600 | }) | ||
598 | 601 | ||
599 | const threads = type === 'live' | 602 | const threads = type === 'live' |
600 | ? CONFIG.LIVE.TRANSCODING.THREADS | 603 | ? CONFIG.LIVE.TRANSCODING.THREADS |
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 0e4ee4a0a..182bdf9cc 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts | |||
@@ -356,8 +356,11 @@ const VIDEO_RATE_TYPES: { [ id: string ]: VideoRateType } = { | |||
356 | } | 356 | } |
357 | 357 | ||
358 | const FFMPEG_NICE: { [ id: string ]: number } = { | 358 | const FFMPEG_NICE: { [ id: string ]: number } = { |
359 | THUMBNAIL: 2, // 2 just for don't blocking servers | 359 | // parent process defaults to niceness = 0 |
360 | TRANSCODING: 15 | 360 | // reminder: lower = higher priority, max value is 19, lowest is -20 |
361 | THUMBNAIL: 2, // low value in order to avoid blocking server | ||
362 | LIVE: 9, // prioritize over VOD | ||
363 | VOD: 15 | ||
361 | } | 364 | } |
362 | 365 | ||
363 | const VIDEO_CATEGORIES = { | 366 | const VIDEO_CATEGORIES = { |