php.net |  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
Votes:1
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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
22 + 35 = ?
Subscribe to this entry?

 
 [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.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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] georg@php.net
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 Apr 18 00:01:28 2024 UTC