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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC