December 18, 2006

Geek

Isolated Out Of Existence

I've been hot on the track of my here-again/gone-again memory leak since about 1 AM. It didn't show up during my torture test, but when I changed the test to find out how many realistic pages I could generate per second - as opposed to 5MB monsters - it was back in spades.

First I suspected that it might be the thread-local data, which can persist between requests. But a bit of debugging showed that this data wasn't growing.

And a bit more debugging showed that the leak still occurred when I disconnected the entire Minx module from the dispatch code and just returned a static string.

And a bit more debugging showed that the leak even occurred with the CherryPy "Hello, World!" example.

If the tools.sessions option was set in the config file.

So then - a bug in the CherryPy session tracking code!

...

Not quite. Well, possibly a small one, but I'm not certain of that.

By default, CherryPy sessions last for 60 minutes, and (also by default) it can be another 5 minutes before the background cleanup task removes them.

Meanwhile, I was hitting CherryPy with anything up to 150 requests per second. And since I was using wget for the testing, rather than a browser, I was throwing the session cookies away.

So I had something like 500,000 sessions active at any time. And CherryPy appears to use about 300 bytes per session.

I didn't notice this with my torture test because that was generating less than 1000 requests an hour. 300kB of overhead is hard to spot on a 70MB process (10 threads, 5MB pages). 150MB of overhead on a 25MB process (100 threads, 100kB pages) is rather more noticeable.

There's still a problem with Minx slowing down over time. The page generation time in my current test has slowed by 75μs over the last 50,000 pages. I had chalked this trend up to the memory leak, but there may be another problem I need to address.

Well, at least I've made progress. I haven't fixed anything - except my test bed - but I have ascertained that the bug doesn't exist.

And I also know that CherryPy can cope with 500,000 simultaneous sessions...

Posted by: Pixy Misa at 04:35 AM | Comments (87) | Add Comment | Trackbacks (Suck)

1 Hello. That's very nice site but I've seen this before here:
http://text.inguaro.com/ad72fc27f85a684c78adde4705f0f949
ad72fc27f85a684c78adde4705f0f949

Posted by: Leland at March 18, 2009 07:55 PM (/NOH4)

2 Hello. That's very nice site but I've seen this before here:
[url]http://bb2.inguaro.com/ad72fc27f85a684c78adde4705f0f949[/url]
ad72fc27f85a684c78adde4705f0f949

Posted by: Leland at March 18, 2009 07:55 PM (/NOH4)

3 Alicia Hall
http://babiesindanger.com/games/customized-photos/?Alicia-Hall
Marlene Dietrich
http://babiesindanger.com/games/customized-photos/?Marlene-Dietrich
Ursula Mayes
http://babiesindanger.com/games/customized-photos/?Ursula-Mayes
Sally Field
http://babiesindanger.com/games/customized-photos/?Sally-Field
Liliana Dominguez
http://babiesindanger.com/games/customized-photos/?Liliana-Dominguez
Kelly Lynch
http://babiesindanger.com/games/customized-photos/?Kelly-Lynch
Caroline Francischini
http://babiesindanger.com/games/customized-photos/?Caroline-Francischini
Klaxons
http://babiesindanger.com/games/customized-photos/?Klaxons
The Rasmus
http://babiesindanger.com/games/customized-photos/?The-Rasmus
Sherri Shepherd
http://babiesindanger.com/games/customized-photos/?Sherri-Shepherd

Posted by: Valentin at April 22, 2009 05:23 AM (fUXWc)

4



















Posted by: Griffin at April 27, 2009 08:39 PM (hteJu)

5 qkbpjde mobqbnw [url=http://hvyxhxu.com]hvyxhxu[/url] http://oroivel.com

Posted by: Hello at May 05, 2009 01:13 PM (ZiOjt)

6 doors.txt;7

Posted by: Alex at July 03, 2010 12:20 AM (lrfca)

7 doors.txt;10

Posted by: Alex at July 26, 2010 02:37 AM (EazTT)

Hide Comments | Add Comment






Processing 0.0, elapsed 0.0136 seconds.
16 queries taking 0.0096 seconds, 29 records returned.
Page size 12 kb.
Powered by Minx 0.8 beta.