[mod_python] mysql_python connections

Trevor West trevorw at qalabs.com
Thu Nov 25 12:21:46 EST 2004


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 
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.

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'.
>
>  
>


More information about the Mod_python mailing list