views:

27

answers:

1

I have a shell script that runs very cpu intensive programs. FFMPEG,ffmpeg2theora,etc. and I want to be able to run them but not choke the server. Is there something I can do to make sure the running programs are running as fast as possible but not hurting the server?

Like a priority system...if something else comes along that needs it the other programs drop in priority aka cpu usage. I know there is "nice" but with the above programs are not working with it.

I played with cpulimit but that makes me say it can't go higher than that even though there may be a light load and it could handle more.

Any existing unix tools or ideas?

+3  A: 

I know there is "nice" but with the above programs are not working with it.

Can you define "not working"? Setting a nice value of 20 should allow the program to use as much CPU time as possible, yielding to anything of a higher priority that needs the CPU.

What nice doesn't do is throttle I/O. Video conversion is kind of I/O dependent. For that, there's ionice, but that comes with some caveats.

Charles
"not working" means cpu is at 99-100% and can't browse a webpage on the server.
Keith
Have you checked the process' nice level in `ps`? Try viewing all processes using `top`, also check `iostat`. You might be dealing with an I/O issue here, not a CPU use issue. Also, make sure that you're nice-ing the right way. Higher numbers mean lower priority, lower (negative) numbers mean higher priority.
Charles