php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38283 mysql_pconnect can't reuse the connections
Submitted: 2006-08-01 14:39 UTC Modified: 2006-08-10 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: sanry at now dot net dot cn Assigned:
Status: No Feedback Package: MySQL related
PHP Version: 5.1.4 OS: SUSE9.3 x86_64
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: sanry at now dot net dot cn
New email:
PHP Version: OS:

 

 [2006-08-01 14:39 UTC] sanry at now dot net dot cn
Description:
------------
mysql_pconnect  create too many connections ,
not using the same connection in x86_64
(web server and mysql server not in the same computer)

I have test in 32bit system is okay,
both using the same mysql5.0.22
 

Reproduce code:
---------------
<?php
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
}
flush();
$t1=getmicrotime();//start time

$db=mysql_pconnect("61.145.112.136", "test", "test");   
 if($db) echo $i.'connect successfully<br/>';
  echo mysql_stat($db).'<br/>';

$t2=getmicrotime();
$tt=$t2-$t1;
$sql="SHOW PROCESSLIST ";
$res=mysql_query($sql);
if($res){
        $dbstatus=mysql_num_rows($res);
}else $dbstatus=mysql_error();
//mysql_close($db);

echo "there are ".$dbstatus." connections ";
echo "time for connect is $tt ***";

?>



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-02 10:13 UTC] tony2001@php.net
Can't reproduce with Apache2.0.55/worker and 5.2-CVS on Intel 64 server.
I get 1 persistent connection per Apache child/thread and this is the expected result.
 [2006-08-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 13:01:28 2025 UTC