I need to limit the CPU usage for the following command since its using 100% of the CPU.
shell_exec("swfrender $swfFile -X 1600 -o $imageFile");
I found that I can use CPULimit and Nice, but I don’t know how to set them up.
can anyone give me a simple example of how to limit the CPU usage of the above shell_exec task?
A single look into the
nicemanpage reveals that you can use that command to start other commends with a specified nice level being set. So in your case I suggest you simply try this:I suggest you find out about the manpages installed on every unix like system. How to read them and how to find entries in there. Start by reading the manpage for the
mancommand:man man🙂