views:

31

answers:

1

I'm running a LAMP stack. When I go into phpmyadmin, I can see that there are quite a number of sleeping connections which probably should be closed. Is there a way, using either Apache or MySQL, to determine on which pages those connections are created?

+1  A: 

You will need to log some details from PHP scripts, the following might help:

  1. mysql_thead_id
  2. $_SERVER['PHP_SELF']
  3. $_SERVER['SCRIPT_FILENAME']

Then you can trace the hanging connections seen from phpmyadmin.

newtover