I am trying to use cpulimit
for testing an app I'm developing under low resource conditions, and I need the process to start under the influence of cpulimit
. It is not sufficient to start the program and later apply cpulimit
. The example on the cpulimit page does not work for me.
The example is this:
cpulimit --limit 40 /etc/rc.d/rc.boinc start
And I'm doing this:
cpulimit --limit 40 a.out start
This is unrelated to cpulimit. Running a.out
directly on the command line wouldn't have worked either. When you execute a program without specifying any directory component, the program is looked up in the PATH. The current directory is normally not in the PATH, so you need to give an explicit directory indication.
cpulimit -l 40 -- ./a.out start
It's also generally a good practice to end the options with "--", so cpulimit, or whatever command, won't interpret wrong what comes after that, as an option, when it's part of a file name or an option to a different program.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加