How to limit CPU usage in Python
Cameron Simpson
cs at zip.com.au
Fri Sep 21 19:44:04 EDT 2012
More information about the Python-list mailing list
Fri Sep 21 19:44:04 EDT 2012
- Previous message (by thread): How to limit CPU usage in Python
- Next message (by thread): How to limit CPU usage in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 20Sep2012 12:53, Terry Reedy <tjreedy at udel.edu> wrote: | On 9/20/2012 12:46 PM, Terry Reedy wrote: | > On 9/20/2012 11:12 AM, Rolando CaƱer Roblejo wrote: | >> Is it possible for me to put a limit in the amount of processor usage (% | >> CPU) that my current python script is using? Is there any module useful | >> for this task? I saw Resource module but I think it is not the module I | >> am looking for. Some people recommend to use nice and cpulimit unix | >> tools, but those are external to python and I prefer a python solution. | >> I am working with Linux (Ubuntu 10.04). | > | > Call the external tools with subprocess.open. | | I meant to end that with ? as I don't know how easy it is to get the | external id of the calling process that is to be limited. I presume that | can be done by first calling ps (with subprocess) and searching the | piped-back output. If you're limiting yourself, os.getpid(). -- Cameron Simpson <cs at zip.com.au>
- Previous message (by thread): How to limit CPU usage in Python
- Next message (by thread): How to limit CPU usage in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list