1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Add priority to transcoding jobs

(1 = highest priority)

100 for new resolutions
10 for original file optimization

Add a malus for transcoding jobs depending on how many uploads the user did in the
last 7 days
This commit is contained in:
Chocobozzz 2021-01-21 16:57:21 +01:00 committed by Chocobozzz
parent 92c871b405
commit 77d7e851dc
15 changed files with 172 additions and 79 deletions

View file

@ -179,6 +179,12 @@ const REPEAT_JOBS: { [ id: string ]: EveryRepeatOptions | CronRepeatOptions } =
cron: randomInt(1, 20) + ' * * * *' // Between 1-20 minutes past the hour
}
}
const JOB_PRIORITY = {
TRANSCODING: {
OPTIMIZER: 10,
NEW_RESOLUTION: 100
}
}
const BROADCAST_CONCURRENCY = 10 // How many requests in parallel we do in activitypub-http-broadcast job
const CRAWL_REQUEST_CONCURRENCY = 1 // How many requests in parallel to fetch remote data (likes, shares...)
@ -851,6 +857,7 @@ export {
VIDEO_STATES,
QUEUE_CONCURRENCY,
VIDEO_RATE_TYPES,
JOB_PRIORITY,
VIDEO_TRANSCODING_FPS,
FFMPEG_NICE,
ABUSE_STATES,