php will close the connection when the script finishes unless you are using mysql_pconnect which opens a persistent connection.
http://za2.php.net/manual/en/ref.msql.php Paul Roberts [EMAIL PROTECTED] ++++++++++++++++++++++++ ----- Original Message ----- From: "Joseph Bueno" <[EMAIL PROTECTED]> To: "Markus Fischer" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, June 23, 2002 6:36 PM Subject: Re: Threads or Prozesses on Linux, and how to control them? Markus Fischer wrote: > [Please CC: directly to me, I'm not subscribed] > > Hi, > > maybe a pointer to the documentation is sufficient, but does > mysqld uses linux-threads or processes? mysqld uses threads (you already found the right documentation). > > And is there way to control them? After I start up mysqld I > see 3 processes with ps. After some time (e.h. 12 hours) I > spotted about 24 (!) of them. > > I've enabled sql logging and see that only every few seconds > requests are comming, even more time. I never see the number > if processes shrinking and I don't remember setting a limit > somewhere (compared to apache where I can control this). > > On http://www.mysql.com/doc/M/y/MySQL_threads.html I found > > "Every connection has its own thread." > > A few senteces above on this page there were talks about > tcp/ip, but I'm only using sockets for the whole time, so > this applies there too? > You get one thread per client connection. It is the same for any communication channel (TCP/IP, UNIX socket,...). > How long is the life-time of a connection if there's no > request comming anymore? The mysqld is acesssed with PHP and > I'm using normal mysql_connect() so connections aren't > persisten so they should go after some time? > > The thread is created when a client opens a new connection and destroyed when the client closes the connection (unless you explicitely ask mysqld to keep some of them, see 'thread_cache_size' server parameter). I have no experience with PHP, are you sure that the connection is closed at the end of the HTTP request ? > thx for any hints, > > - Markus > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > Regards -- Joseph Bueno --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php