How can I tell what a Zope Process is doing?
Hi, I have a Zope instance whose memory usage is ballooning every so often (to 800Mb or so :-S) Now, I can see using top that one Zope process is using a lot of CPU and I'm guessing it's doing some silly iteration that's dragging huge numbers of objects into memory. The problem is that I'm having a pretty hard time figuring out what this process is doing and how I can prevent it. So, does anyone have any idea how I can find out? As a related question, does the line get written to Z2.log before or after serving the request has been completed? Hmmm, just had another thought. Does ChrisM's 'big m' logging show how much memory was used to serve a particular request? cheers, Chris
On Tuesday 18 February 2003 4:04 pm, Chris Withers wrote:
Hi,
I have a Zope instance whose memory usage is ballooning every so often (to 800Mb or so :-S) Now, I can see using top that one Zope process is using a lot of CPU and I'm guessing it's doing some silly iteration that's dragging huge numbers of objects into memory.
If you have got a live one then "Control Panel" / "Debug Information" will show current requests.
As a related question, does the line get written to Z2.log before or after serving the request has been completed?
You mean the log that has a field for the number of bytes sent back to the client? ;-) -- Toby Dickenson http://www.geminidataloggers.com/people/tdickenson
Toby Dickenson wrote:
If you have got a live one then "Control Panel" / "Debug Information" will show current requests.
Yaknow, I never even noticed that and it could be exactly what I'm after... thanks, Chris
On Tue, 2003-02-18 at 13:04, Chris Withers wrote:
[...] The problem is that I'm having a pretty hard time figuring out what this process is doing and how I can prevent it. So, does anyone have any idea how I can find out?
This page has really helped me in the past http://www.zope.org/Members/4am/debugspinningzope
As a related question, does the line get written to Z2.log before or after serving the request has been completed?
I don't know, but it's easy to find out. Create an external method that sleeps for a number of seconds. You can also experiment with RESPONSE.write() to see if it affects anything.
Hmmm, just had another thought. Does ChrisM's 'big m' logging show how much memory was used to serve a particular request?
I don't think so. I can't think of a way you could have this information from python seeing that, on linux at least, all memory is owned by all threads of a process. You could try to install the ForensicLogger and configure a small interval between measurements. http://www.zope.org/Members/mcdonc/Products/ForensicLogger Cheers, Leo -- Ideas don't stay in some minds very long because they don't like solitary confinement.
Leonardo Rochael Almeida wrote:
Thanks for the links :-) cheers, Chris
Chris Withers wrote at 2003-2-18 16:04 +0000:
I have a Zope instance whose memory usage is ballooning every so often (to 800Mb or so :-S) Now, I can see using top that one Zope process is using a lot of CPU and I'm guessing it's doing some silly iteration that's dragging huge numbers of objects into memory.
The problem is that I'm having a pretty hard time figuring out what this process is doing and how I can prevent it. So, does anyone have any idea how I can find out?
When your Zope comes back again (i.e. stops iterating finally), you can use my ZopeProfiler <http://www.dieter.handshake.de/pyprojects/zope> to learn what is using time (not memory!) in your Zope instance.
As a related question, does the line get written to Z2.log before or after serving the request has been completed?
Its written after the request. Only then, the response code and Content-Length is known.
Hmmm, just had another thought. Does ChrisM's 'big m' logging show how much memory was used to serve a particular request?
No, as memory consumption is not attributed to a thread (and therefore a request). Dieter
Dieter Maurer wrote:
When your Zope comes back again (i.e. stops iterating finally), you can use my ZopeProfiler <http://www.dieter.handshake.de/pyprojects/zope> to learn what is using time (not memory!) in your Zope instance.
I know about your excellent profiler already, but the problem here is memory rather than CPU usage. cheers, Chris
participants (4)
-
Chris Withers -
Dieter Maurer -
Leonardo Rochael Almeida -
Toby Dickenson