Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to limit CPU usage in Python
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Terry Reedy  
View profile  
 More options Sep 20 2012, 12:53 pm
Newsgroups: comp.lang.python
From: Terry Reedy <tjre...@udel.edu>
Date: Thu, 20 Sep 2012 12:53:41 -0400
Local: Thurs, Sep 20 2012 12:53 pm
Subject: Re: How to limit CPU usage in Python
On 9/20/2012 12:46 PM, Terry Reedy wrote:

> On 9/20/2012 11:12 AM, Rolando Cañer Roblejo wrote:
>> Hi all,

>> 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.

--
Terry Jan Reedy


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.