Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ffmpeg with nice/ionice #1192

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

ffmpeg with nice/ionice #1192

wants to merge 1 commit into from

Conversation

pwilczynskiclearcode
Copy link
Contributor

No description provided.

@@ -25,6 +25,7 @@ func MuxTStoMP4(tsInputFile, mp4OutputFile string) ([]string, error) {
// transmux the .ts file into a standalone MP4 file
ffmpegErr := bytes.Buffer{}
err := ffmpeg.Input(tsInputFile).
SetFfmpegPath("/path/to/ffmpeg-nice.sh").
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -81,7 +82,7 @@ func MuxTStoFMP4(fmp4ManifestOutputFile string, inputs ...string) error {

timeout, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
defer cancel()
cmd := exec.CommandContext(timeout, "ffmpeg", args...)
cmd := exec.CommandContext(timeout, "/path/to/ffmpeg-nice.sh", args...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pseudo-code or just a starting point for discussion. I'm not even sure if these two places are the correct ones for VOD processing

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the MP4 generation step. There's ffmpeg usage in different places for for segmenting, thumbnailing, clipping, etc. Just grep-ing ffmpeg or CommandContext | grep ffmpeg should get you most of the instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're not fully sure yet but it looks like some ffmpeg for big VODs are congesting both disk writes on datapacket servers and generate big egress spikes resulting in entire server slowdown and k3s restarts.
We're testing with Rafał if moving VOD processing onto just one of the nodes in the cluster results in less or zero restarts of the rest of the nodes.

@emranemran
Copy link
Collaborator

What problem are we trying to solve? nice-ing to such a low priority may make the full transcode cycle much slower. Did this change make some problems go away?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants