MySQL Forums
Forum List  »  Performance

Dropped/Slow connections to MySQL from PHP
Posted by: Scott Kimball
Date: March 18, 2005 12:50AM

Howdie --

I am running PHP 4.3.9 on Windows 2000/IIS 5.0 with Zend's WinEnabler software. On a separate, dedicated Windows 2000 server, I am running MySQL 4.1.10. Our volume has been increasing lately, and we have been getting some complaints about slow response time on pages.

As we have been logging/debugging, it appears that our php.exe processes are not keeping their connection to MySQL open. In the case of both PHP processes shown in the log exerpts below, within a relatively short amout of time, they are acquiring multiple connections to the MySQL server. All of our connections are made with the same credentials and all our queries are made with the database.tablename syntax (i.e. we do not call mysql_select_db()). When I check the MySQL processlist, many of the prior MySQL threads are sitting idle never to be used again until the server prunes them

DATE TIME | MYSQL ID | PHP ID | TIME TAKEN FOR MYSQL_PCONNECT()
12-Mar-2005 05:05:31 | MySQL: 14 | PHP: 2964 | 7.14707
12-Mar-2005 08:03:14 | MySQL: 18 | PHP: 2964 | 6.75661
12-Mar-2005 08:21:58 | MySQL: 20 | PHP: 2964 | 27.34511
12-Mar-2005 08:36:31 | MySQL: 21 | PHP: 2964 | 41.19499
12-Mar-2005 08:57:42 | MySQL: 23 | PHP: 2964 | 27.37617

12-Mar-2005 00:07:35 | MySQL: 9 | PHP: 3164 | 27.40099
12-Mar-2005 05:05:24 | MySQL: 13 | PHP: 3164 | 6.85342
12-Mar-2005 07:27:33 | MySQL: 15 | PHP: 3164 | 6.76609
12-Mar-2005 07:42:29 | MySQL: 16 | PHP: 3164 | 27.37794
12-Mar-2005 07:53:19 | MySQL: 17 | PHP: 3164 | 41.20115
12-Mar-2005 08:03:42 | MySQL: 19 | PHP: 3164 | 41.19298

I have been working with the Zend folks on this, but they seem to be trying to pin the problem on the MySQL server and/or driver. Has anyone else seen this kind of slowdown? Any pointers or ideas would be most appreciated.

thanks,
Scott

Options: ReplyQuote


Subject
Views
Written By
Posted
Dropped/Slow connections to MySQL from PHP
2572
March 18, 2005 12:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.