Re: CPU usage while reading a named pipe

2009-09-13 Thread Nick Craig-Wood
Miguel P wrote: > On Sep 12, 2:54 pm, Ned Deily wrote: > > In article > > , > >  Miguel P wrote: > > > I've been working on parsing (tailing) a named pipe which is the > > > syslog output of the traffic for a rather busy haproxy instance. It's > > > a fair bit of traffic (upto 3k hits/s per ser

Re: CPU usage while reading a named pipe

2009-09-12 Thread Miguel P
On Sep 12, 2:54 pm, Ned Deily wrote: > In article > , >  Miguel P wrote: > > > > > I've been working on parsing (tailing) a named pipe which is the > > syslog output of the traffic for a rather busy haproxy instance. It's > > a fair bit of traffic (upto 3k hits/s per server), but I am finding > >

Re: CPU usage while reading a named pipe

2009-09-12 Thread Ned Deily
In article , Miguel P wrote: > I've been working on parsing (tailing) a named pipe which is the > syslog output of the traffic for a rather busy haproxy instance. It's > a fair bit of traffic (upto 3k hits/s per server), but I am finding > that simply tailing the file in python, without any pro

Re: CPU usage while reading a named pipe

2009-09-12 Thread MRAB
Miguel P wrote: Hey everyone, I've been working on parsing (tailing) a named pipe which is the syslog output of the traffic for a rather busy haproxy instance. It's a fair bit of traffic (upto 3k hits/s per server), but I am finding that simply tailing the file in python, without any processing

Re: CPU usage.

2007-05-09 Thread Gabriel Genellina
En Wed, 09 May 2007 02:58:45 -0300, Navid Parvini <[EMAIL PROTECTED]> escribió: > I want to get the CPU usage in my code. > Is there any module in Python to get it? > Also I want to get in on Windows and Linux. On Windows you can use WMI; Tim Golden made an excellent library that let's yo

Re: CPU usage

2007-05-08 Thread Tim Golden
Navid Parvini wrote: > I want to get the CPU usage in my code. > Is there any module in Python to get it? What Operating System are you on? TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: cpu usage limit

2005-05-29 Thread garabik-news-2005-05
[EMAIL PROTECTED] wrote: > I understand, that what I suggest does not solve the problem you want, > but.. > > Why do you want to restrict CPU usage to 30%? In Windows I run CPU there might be three reasons: 1) less power consumed (notebooks, PDA's) 2) less heat from CPU 3) (cross platform) schedu

Re: cpu usage limit

2005-05-27 Thread elbertlev
I understand, that what I suggest does not solve the problem you want, but.. Why do you want to restrict CPU usage to 30%? In Windows I run CPU intesive therads on IDLE priority, while interfacand/or communication threads run on normal. This gives me best of two worlds: 1. I use 100% CPU (good) an

Re: cpu usage limit

2005-05-27 Thread Peter Hansen
rbt wrote: > [EMAIL PROTECTED] wrote: >> finished = False >> while not finished: > > Why don't you just write 'while True'??? 'while not false' is like > saying 'I am not unemployed by Microsoft' instead of saying 'I am > employed by Microsoft'. It's confusing, complex and unnecessary. Lawyers

Re: cpu usage limit

2005-05-27 Thread Paul Rubin
"mmf" <[EMAIL PROTECTED]> writes: > How can I make sure that a Python process does not use more that 30% of > the CPU at any time. I only want that the process never uses more, but > I don't want the process being killed when it reaches the limit (like > it can be done with resource module). > > C

Re: cpu usage limit

2005-05-27 Thread Grant Edwards
On 2005-05-27, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >>> How can I make sure that a Python process does not use more that 30% of >>> the CPU at any time. I only want that the process never uses more, but >>> I don't want the process being killed when it reaches the limit (like >>> it can be

Re: cpu usage limit

2005-05-27 Thread rbt
[EMAIL PROTECTED] wrote: > rbt <[EMAIL PROTECTED]> wrote: > >>mf wrote: >> >>>Hi. >>> >>>My problem: >>>How can I make sure that a Python process does not use more that 30% of >>>the CPU at any time. I only want that the process never uses more, but >>>I don't want the process being killed when it

Re: cpu usage limit

2005-05-27 Thread Markus Franz
> Are you looping during a cpu intensive task? If so, make it sleep a bit > like this: > > for x in cpu_task: > time.sleep(0.5) > do(x) No, I don't use an intensive loop. I have about 1200 lines of code inside a process - is there nothing like xyz.setlimit(xyz.cpu, 0.30) ??? Thank. M

Re: cpu usage limit

2005-05-27 Thread garabik-news-2005-05
rbt <[EMAIL PROTECTED]> wrote: > > mf wrote: >> Hi. >> >> My problem: >> How can I make sure that a Python process does not use more that 30% of >> the CPU at any time. I only want that the process never uses more, but >> I don't want the process being killed when it reaches the limit (like >> it

Re: cpu usage limit

2005-05-27 Thread rbt
mf wrote: > Hi. > > My problem: > How can I make sure that a Python process does not use more that 30% of > the CPU at any time. I only want that the process never uses more, but > I don't want the process being killed when it reaches the limit (like > it can be done with resource module). > > C