[mod_python] mysql_python connections

Daniele Cruciani crxop at tiscali.it
Fri Nov 26 05:11:05 EST 2004


On Thu, Nov 25, 2004 at 10:21:46AM -0700, Trevor West wrote:
> Hi, thanks for the advice, when I do the command you advised "mysqladmin 
> -p processlist', These are the responses I get
> 
> Before Login:
> 0
> 
> First pages after login screen (choice page):
> 1 Connection to database12
> 
> Main screen with list:
> 4 connections to database12
> 
> Logout:
> 5 connections to database12
> 
> Now I know that I'm doing something wrong here, but I just can't figure 
> it out. I close all the database connections that I open (or I think I 
> do) but this still seems a bit much. Also it's now been 5 minutes
> and 

Try to check branch, your code don't call close() on connection for
some reason.

> they still show up as open. Do you have any idea what I can do to help 
> this. When I first tried to do this app I tried to put a single database 
> connection in the session, but that didn't work at all (I think I even 
> successfully crashed apache once I'm proud to say), so I started opening 
> a connection on every page and closing them at the end of the page 
> generation. The problem seems to be though that some aren't getting
> closed.

I suppose you open more than a connection per page, and this is not
what you want, probably you have a complex page to show

> 
> Cheers
> 
> Trevor
> 
> 
> 
> 
> 
> Damjan wrote:
> 
> >>as soon as I'm done all that I want to do. I was wondering if my 
> >>connection was staying active because of threads.
> >>   
> >>
> >
> >What threads?
> >
> > 
> >
> >>When I log into my application then log out again there are 3 more MySQL 
> >>processes running when I check "ps -ef | grep mysql " then there were 
> >>before. 
> >>   
> >>
> >
> >Which doesn't mean that mod_python is still connected to the database.
> >It just means that MySQL will not kill those processes, since they might
> >be needed again pretty soon.
> >
> >To see how many connections are there to the DB, and what each is doing,
> >use 'mysqladmin -p processlist'.
> >
> > 
> >
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python


More information about the Mod_python mailing list