|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19030 performance issues with mysql extension
Submitted: 2002-08-22 00:11 UTC Modified: 2002-08-27 01:53 UTC
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: bob at bravenet dot com Assigned: georg (profile)
Status: Wont fix Package: MySQL related
PHP Version: 4.2.2 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bob at bravenet dot com
New email:
PHP Version: OS:


 [2002-08-22 00:11 UTC] bob at bravenet dot com
When establishing a persistent connection, if PHP finds an existing connection it will do a mysql_stat() on the link that it found and then check the error for CR_SERVER_GONE_ERROR then reconnects on failure. I believe mysql's C API has a better function to do what is performed. The mysql_ping() api function will perform the same functionality at a lower cost in performance. The original host/port/user/pass information should be retained in the mysql link structure so that a failed mysql_ping() will reconnect automatically to the database server.

This also removes the logging entry caused by a mysql status command. This does have an impact for sites with a higher load.

Thanks for you consideration on this.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-22 00:17 UTC] bob at bravenet dot com
I moved this to a bug category. As I gave it more thought I feel that the fact that mysql_stat causes logging and PHP's improper use of it to determine an active connection when other facilities (mysql_ping()) exist really is a bug.
 [2002-08-27 01:53 UTC]
If MySQL 4.1 becomes stable, we will integrate master/slave and SSL support in the mysql_connect/pconnect functions, and have to change the reconnect procedure.
With this additional functionality, it looks like we will 
run in some problems, when using mysql_ping().
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 17:01:27 2024 UTC