<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.10">
</HEAD>
<BODY>
Also, MySQLdb has known garbage collection issues, which I think are not yet fixed in the main release, so you'll need to get a cvs version or patch it yourself. Looking through the sf.net forums/bug reports for MySQLdb for the details and what you can do. And it still doesn't hurt to keep MaxClientRequests around 100 for apache as well.<BR>
<BR>
Mike<BR>
<BR>
On Wed, 2004-07-14 at 12:39, Sean Abrahams wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#737373"><I>On Sat, 10 Jul 2004 09:03:44 -0700, Paul Eden
<peden@americanphysicians.net> wrote:
> I created an intranet application with mysql and mod_python and am
> having trouble with extra mysqld processes on the server.
>
> They don't seem to be being destroyed/collected until I restart the
> mysql server.
>
> This is probably some error on my part in coding the application, but I
> am not sure where the problem is.
>
> Will someone please tell me at what point in the DB API specification
> the extra mysqld are destroyed if at all or how I can get rid of them
> after they are finished? Is it just connection.close()?
Mod_python is a long living process. As long as Apache is running, so
is your mod_python application. Whenever you make a connection to a
database from your mod_python application, it will not be disconnected
until you call connection.close() or you stop Apache or MySQL.
What you will need to do is create a ConnectionPool which will store
connections to the database and hand them out when you need them.
There is a FAQ entry on the mod_python web site:
</FONT>
<A HREF="http://www.modpython.org/FAQ/faqw.py?req=show&file=faq03.003.htp"><U>http://www.modpython.org/FAQ/faqw.py?req=show&file=faq03.003.htp</U></A>
<FONT COLOR="#737373">
Although, the example only shows how to connect to one database, not
multiples. If you are connecting to multiple different databases, make
DB_CONN a dict that stores each database connection in its own key.
--Sean
> mod_python-3.1.3-1
> MySQL-python-0.9.1-6
> python-2.2.3-5
> httpd-2.0.46-32.ent.3
> Red Hat Enterprise Linux ES release 3
>
> Thank You,
>
> Paul
>
> _______________________________________________
> Mod_python mailing list
> Mod_python@modpython.org
> </FONT><A HREF="http://mailman.modpython.org/mailman/listinfo/mod_python"><U>http://mailman.modpython.org/mailman/listinfo/mod_python</U></A>
<FONT COLOR="#737373">>
_______________________________________________
Mod_python mailing list
Mod_python@modpython.org</FONT>
<A HREF="http://mailman.modpython.org/mailman/listinfo/mod_python"><U>http://mailman.modpython.org/mailman/listinfo/mod_python</U></I></A></PRE>
</BLOCKQUOTE>
<PRE><TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<FONT COLOR="#999999">__________________________________ </FONT><BR>
<BR>
<A HREF="mailto:michael.neel@mediapulse.com"><FONT COLOR="#000000" SIZE="2"><B><U>michael.neel</B></FONT></A><A HREF="mailto:michael.neel@mediapulse.com"><FONT COLOR="#808080" SIZE="2">@mediapulse.com</U></A><BR>
vice president of information systems<BR>
865.675.4455 x30<BR>
800.380.4514</FONT><BR>
<BR>
<A HREF="http://www.mediapulse.com/"><FONT COLOR="#a51c1e" SIZE="2"><U>www.mediapulse.com</U></FONT></A><BR>
<FONT COLOR="#999999">__________________________________</FONT>
</TD>
</TR>
</TABLE>
</PRE>
</BODY>
</HTML>