[python-win32] Pythonservice.exe running at 100%

David Rock David Rock <david@rock.homelinux.com>
Tue, 19 Mar 2002 16:12:13 -0600


On Tue, Mar 19, 2002 at 03:00:24PM -0600, David Rock wrote:
> On Tue, Mar 19, 2002 at 05:13:30PM +1100, Mark Hammond wrote:
> > > Every time I try to run a service on Windows NT4, it always runs at 100%
> > > CPU utilization. Why does pythonservice.exe do this and is there any way
> > > that I can throttle it back? I have managed to minimize the amount of
> > > time that the service app I am running takes, so that it is not a
> > > tremendous strain on the system (just a couple seconds) but I would like
> > > to manage this better.
> > 
> > Something is almost certainly wrong with your service.  The test services do
> > not exhibit this.  Check that your loops that are supposed to be waiting for
> > something actually are :)
> 
> Is there any chance that the version of Python and the WIn32 extensions
> will be a factor in this? I am currently using Python 2.1.1 from
> Python.org with Win32all-145.
> 
> I am in the process of downloading 2.2 and win32all-146 to see if it
> makes a difference.

I have tried this with Python 2.2 and Win32all-146 and I get the same
thing. The cpu pegs at 100% whenever it is running. I suppose this is
just because the service isn't really designed well as an event-driven
app, since the whole point of it is to see what happens when you run I/O
constantly X number of times. I would still like to know why there is
such a drastic difference between the standalone's speed and the
service's speed (loops=1000 and loops=25 respectively).

Oh well. I guess I'll just make sure I test it out before using it in
production ;-)

BTW, thanks for the development Mark. This will prove invaluable for
what I am doing at work.

-- 
David Rock
david@rock.homelinux.com