0

I have multiple instances of a Ruby script (running on Linux) that does some automated downloading and every 30 minutes it calls "ffprobe" to programmatically evaluate the video download.

Now, during the downloading my processor is at 60%. However, every 30 minutes (when ffprobe runs), my processor usage skyrockets to 100% for 1 to 3 minutes and ends up sometimes crashing other instances of the Ruby program.

Instead of this, I would like to allocate lesser cpu resources to the processor heavy ffprobe, so it runs slowly. i.e. I would like it to use - say, a max of 20% of the CPU and it can run as long as it likes. So, one might expect it to take 15 minutes to complete a task that it now takes 1-3 minutes to complete. That's fine with me.

This will then prevent crashing of my critical downloading program that should have the highest priority.

Thank you!

Carlos F
  • 893
  • 2
  • 12
  • 30
  • What OS are you using? You're most likely looking for a platform-specific solution to limit the processor usage. – Timo Geusch Aug 07 '14 at 17:54
  • 1
    You may find using the `nice` command helps to adjust the priority of your process. There's no OS independent way of computing CPU load. – tadman Aug 07 '14 at 17:59

0 Answers0