Pause linux service (Folding at home) when transcoding starts

I run my folding at home service on my PMS since it’s got a good GPU on it and when no one is watching anything I figure why not use the GPU for folding.
When 1 or 2 people start watching, things still run pretty smooth but when I get more than 3 on their, PMS starts to choke.
Is their a way in Linux (Ubuntu server) to pause or lower F@H resources when transcoding starts then resume folding when transcoding is idle?

Ubuntu Server 22.04.2 LTS (GNU/Linux 5.15.0-75-generic x86_64)
Plex Media Server 1.32.4.7195
Folding at home 7.4.4

launch the folding process with a low priority, then it’ll scale down automatically when something more important happens (like when PMS need the resources)

use nice to do this

Nice :wink:
Thanks!