/srv/irclogs.ubuntu.com/2023/08/01/#ubuntu-server.txt

=== shokohsc517 is now known as shokohsc51
=== chris14_ is now known as chris14
tobias-urdinjamespage: if I could trouble you, when you have a second I would appreciate your feedback related to packaging in https://github.com/gnocchixyz/gnocchi/pull/131208:20
-ubottu:#ubuntu-server- Pull 1312 in gnocchixyz/gnocchi "Use pbr rather than direct easy install" [Open]08:20
jamespagetobias-urdin: feedback provided but I really don't think that will be any problem08:43
=== falcojr8 is now known as falcojr
tobias-urdinjamespage: thanks!08:49
=== shokohsc517 is now known as shokohsc51
=== shokohsc510 is now known as shokohsc51
=== bittin is now known as bittin_working
* bittin_working is installing some Debian and Ubuntu Server at work atm15:37
Odd_BlokeHey folks, does anyone know a way that I could detect an `ffmpeg` process starting on my system and take an action on it?  (Specifically, I'm transcoding my entire library to take up less space, but I'd like to suspend that process if any _other_ ffmpeg process starts, because that activity is definitely higher-priority.)17:56
JanCOdd_Bloke: maybe starting the transcoding process with idle priority is enough?18:09
Odd_BlokeJanC: The process is nice'd, but I still see issues unfortunately.18:15
sarnoldOdd_Bloke: maybe schedtool to set it into batch? my next idea is much less fun :) -- fiddle around with filtering execsnoop-bpfcc output to do what you want, or modify execsnoop.bt to issue the kill / freeze commands directly when needed18:53
JanCOdd_Bloke: idle has lower priority than what you can do with nice (see 'man chrt')18:53
JanCor schedtool indeed18:54
JanCI think schedtool isn't installed by default though?18:55
sarnoldoh, hah18:57
sarnold.. I looked through the kernel sources for SCHED_IDLEPRIO, because that's what's mentioned in schedtool(8). Nothing. But there is a SCHED_IDLE, which is what's referenced in chrt(1)19:00
JanCBTW: even if you have a way to detect that two ffmpeg processes are running, it might not be simple to detect what ffmpeg process needs suspending19:19
JanCunless you look at its command line maybe19:20
sarnold/proc/pid/stat field starttime is the usual way to try to disambiguate multiple processes19:24
JanCbut that still leaves a race condition :)19:24
JanCit might start transcoding the next file just after the other ffmpeg process starts19:25
sarnoldmm true19:31
znfAssuming you are transcoding on the GPU, you can't "nice" that19:44
JanCthat might be another issue indeed19:45
JanCznf: you can't "nice" it or you would have to do it differently?19:45
znfif you "nice" it, you only "nice" the CPU part19:47
znfbut if you do it on the GPU... :)19:47
JanCI meant: is there a GPU task scheduler19:48
JanCor something like that; a way to set priorities for GPU tasks19:48
znfonly for *some* CUDA loads, as far as I know19:49
znfbasically: https://stackoverflow.com/a/6319289/225961219:52
=== sdeziel_ is now known as sdeziel
Odd_BlokeI'm encoding on the CPU, so not a problem for me.20:03
znfassuming he does those processes in a loop, he could write a flock and then check the pid of the script/loop 20:03
Odd_BlokeAnd, yeah, the to-be-stopped ffmpeg process is easily identifiable: it's running in a Docker container, so I can just `pkill --signal STOP ffmpeg` within that container.20:06
sarnoldwoot20:06
Odd_BlokeAnd yeah, the race condition is a possibility, but as the transcodes are taking 12+ hours each, I won't have too many opportunities to hit it. :p20:07
Odd_BlokeJanC: Aha, thanks, I'll try `chrt` out!20:08
Odd_Bloke(One wrinkle is that I'm not launching the ffmpeg processes myself, but a cron which just `chrt`s would be a much easier solution to this problem!)20:09
sarnoldyou could chrt the docker that launches it?20:09
sarnoldscheduling classes are inherited across forks20:10
JanCby default, at least20:10
Odd_BlokeHmm, well a quick test suggests that idle priority still interferes with a streaming transcode session, unfortunately.20:19
sarnold:( dang I liked that idea20:20
Odd_Bloke`chrt --idle -a -p 0 3734540` <-- after adding `-a` (so that the tasks actually doing the work were also changed) it did make a difference, if I wasn't operating with quite so little headroom for live transcodes it would probably have been sufficient20:21
Odd_BlokeBut alas20:21
JanCit's probably easier to just run the transcode with chrt ("chrt -i 0 ffmpeg"), but if it doesn't work...20:35
=== chris14_ is now known as chris14

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!