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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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.

Patches

Pull Requests

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: Sun Dec 22 03:01:28 2024 UTC