I think your problem is probably the threading model that your server is using (and yeah, I guess FCGI does it this way...). when you use sqlite specifically, it uses an instance of pool called SingletonThreadPool which isnt pooled at all; it just holds on to one connection per thread identifier. if your server is spawning new threads for every request and then disposing of the thread, that will create the behavior you are seeing. ill add a note to the docs for this. so what you want in this case, is this patch (which ive also committed in 1764): =================================================================== --- lib/sqlalchemy/pool.py (revision 1761) +++ lib/sqlalchemy/pool.py (working copy) @@ -197,7 +197,13 @@ # sqlite won't even let you close a conn from a thread that didn't create it pass del self._conns[key] - + + def dispose_local(self): + try: + del self._conns[thread.get_ident()] + except KeyError: + pass + def status(self): return "SingletonThreadPool id:%d thread:%d size: %d" % (id(self), thread.get_ident(), len(self._conns)) then you can call sqlite.engine.connection_provider._pool.dispose_local() to remove the connection for the local thread which is about to be disposed. it looks like I might have to give SingletonThreadPool an overhaul to actually maintain a size, since FastCGI is the typical place its going to be used. On Aug 5, 2006, at 2:11 AM, [EMAIL PROTECTED] wrote: We're about ready to go to production with our new website (built using pylons, sqlalchemy 0.2.6/sqlite, and kid), so I thought I would point apachebench at it to see how things performed. I was horrified to see memory consumption going through the roof (i.e. >100MB in less than 10,000 requests!). |
------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________ Sqlalchemy-users mailing list Sqlalchemy-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users