Message boards :
Number crunching :
CPU usage limiter under Linux
Message board moderation
Author | Message |
---|---|
jombo Send message Joined: 19 Jun 05 Posts: 9 Credit: 507 RAC: 0 |
Since this functionality is not supported by kernel, I wrote a simple C program to set an upper limit to cpu usage of a process, known the name of executable file. Its purpose is similar to ThreadMaster service for Windows, though with different mechanisms. It could be nice if it was downloadable from add-on software page (http://setiathome.berkeley.edu/download_network.php). Anyone interested to it? |
jrmm22 Send message Joined: 30 Jan 04 Posts: 353 Credit: 24,536,157 RAC: 0 |
Since this functionality is not supported by kernel, I wrote a simple C program to set an upper limit to cpu usage of a process, known the name of executable file. Sure, I'll give it a try... Designed to work on any kernel? |
Ned Slider Send message Joined: 12 Oct 01 Posts: 668 Credit: 4,375,315 RAC: 0 |
Hi Jombo, This indeed is useful. I was recently looking for a similar thing for my laptop as it gets a little too hot crunching 24/7 over the summer. I thought of the possibility of writing a script to constantly start and stop the client allowing some cool down time but that was far too messy. In the end I was able to limit processor usage by setting the CPU throttling in ACPI but of course this is only possible on mobile chips. I found knocking the CPU back about 10% (to 90%) was enough to keep it a few degrees cooler during summer whereas otherwise I would have probably turned off seti completely during the hot months. I was always surprised that this functionality was not present in the kernel, so this will be a useful utility :) Regards, Ned *** My Guide to Compiling Optimised BOINC and SETI Clients *** *** Download Optimised BOINC and SETI Clients for Linux Here *** |
Paul D. Buck Send message Joined: 19 Jul 00 Posts: 3898 Credit: 1,158,042 RAC: 0 |
Since this functionality is not supported by kernel, I wrote a simple C program to set an upper limit to cpu usage of a process, known the name of executable file. Put a message up on developers mailing list or e-mail Dr. Anderson directly ... |
jombo Send message Joined: 19 Jun 05 Posts: 9 Credit: 507 RAC: 0 |
It should run on any OS supporting /proc filesystem and POSIX signals, so i suppose that every Linux it's ok. Here is the code of the first (very rudimental!) version. Now it's much more powerful and precise.
You shouldn't be suprised, because implementing this limit in kernel process scheduling is a known hard problem, and would affect system performances. In fact, my approach is different: I quickly suspend and resume controlled process so it can't use more than a fixed percentage of cpu time.
Ok, do you have his email address? |
jombo Send message Joined: 19 Jun 05 Posts: 9 Credit: 507 RAC: 0 |
Finally I have published my first version of cpulimit. Go here to download it! Please send me your feedback. |
[AF>Linux]Arnaud Send message Joined: 3 Apr 99 Posts: 70 Credit: 4,852 RAC: 0 |
Hi, I tested it, and it works OK. But how do you limit your CPU when you run several projects (they're changing every hour in BOINC). Do you open several Konsole windows and write: ./cpulimit ~/BOINC/projects/einstein.phys.uwm.edu/einstein_4.80_i686-pc-linux-gnu 50 ./cpulimit ~/BOINC/projects/climateprediction.net/hadsm3_4.13_i686-pc-linux-gnu 50 when you run E@H and CPDN for exemple ? Thanks. Arnaud |
jombo Send message Joined: 19 Jun 05 Posts: 9 Credit: 507 RAC: 0 |
yes actually it's the only way (note: writing executable file name is enough) now cpulimit is only a foregroung program that control one process and has just the functionality. but in the future it might become an advanced daemon with a configuration file where to specify several tasks and relative limits... thanks Arnaud, and stay tuned! |
[AF>Linux]Arnaud Send message Joined: 3 Apr 99 Posts: 70 Credit: 4,852 RAC: 0 |
Ok, thanks for your reply Arnaud |
©2024 University of California
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.