mirror of
https://github.com/joshuaboniface/rffmpeg.git
synced 2026-07-18 00:45:53 +00:00
Adds an optional new configuration format under the remote hosts
configuration segment, allowing the specification of a weight in
addition to the host name.
Weights are used to refactor the active "count" of a host in order to
bring it lower by the following logic:
1. If a host's weight is not specified, it is 1.
2. If a host's weight is 1, its "weighted_count" is equal to its
"count".
3. If a host's weight is greater than 1, its "weighted_count" is equal
to the floor division of its real "count" and its "weight".
So for example, if there are 2 hosts with weights 1 and 2, and there is
currently 1 process running against each, the "weighted_count"s would
be:
host1: 1
host2: 1//2 = 0
And thus host2 would be considered the "least loaded" host. Then, if
another process started:
host1: 1
host2: 2//2 = 1
Resulting in the last host on the list (the first to run a process)
getting the next one, and so on.
This logic should make sense, but I cannot extensively test it.
Closes #8 aspect 1 (aspect 2 is out-of-scope)
57 lines
1.9 KiB
Text
57 lines
1.9 KiB
Text
---
|
|
# Example configuration file for rffmpeg
|
|
# Copy this sample to /etc/rffmpeg/rffmpeg.yml and replace the various attributes
|
|
# with the values for your environment. For more details please see the README.
|
|
|
|
rffmpeg:
|
|
# rffmpeg state configuration - YOU SHOULD NOT ALTER THESE
|
|
state:
|
|
# Temporary directory to store state
|
|
tempdir: "/run/shm/rffmpeg"
|
|
|
|
# Filename format for state instance files
|
|
filename: "instance_{pid}.pid"
|
|
|
|
# Contents of the state instance file
|
|
contents: "{host}"
|
|
|
|
# Logging configuration
|
|
logging:
|
|
# Enable or disable file logging
|
|
file: true
|
|
|
|
# Log messages to this file - ensure the user running rffmpeg can write to it
|
|
logfile: "/var/log/jellyfin/rffmpeg.log"
|
|
|
|
# Remote (SSH) configuration
|
|
remote:
|
|
# A YAML list of remote hosts to connect to; either direct list or name/weight supported
|
|
hosts:
|
|
- localhost
|
|
- name: gpu1
|
|
weight: 2 # Relative to any non-weighted hosts which have weight 1
|
|
|
|
# The remote SSH user to connect as
|
|
user: jellyfin
|
|
|
|
# A YAML list of additional SSH arguments (e.g. private keys),
|
|
# one line per space-separated argument element.
|
|
args:
|
|
- "-i"
|
|
- "/var/lib/jellyfin/id_rsa"
|
|
|
|
|
|
# Remote command configuration
|
|
commands:
|
|
# A YAML list of prefixes to the ffmpeg command (e.g. sudo, nice, etc.),
|
|
# one line per space-separated command element.
|
|
pre:
|
|
- ""
|
|
|
|
# The (remote) ffmpeg and ffprobe command binary paths
|
|
ffmpeg: "/usr/lib/jellyfin-ffmpeg/ffmpeg"
|
|
ffprobe: "/usr/lib/jellyfin-ffmpeg/ffprobe"
|
|
|
|
# An optional local fallback ffmpeg and ffprobe, if you wish this to be different from the above paths
|
|
#fallback_ffmpeg: "/usr/lib/jellyfin-ffmpeg/ffmpeg"
|
|
#fallback_ffprobe: "/usr/lib/jellyfin-ffmpeg/ffprobe"
|