#30584 [Bgs]: cannot connect to mysql server after sending a number of concurrent requests
| From: | it at videinfra dot lv | Date: | Wed, 27 Oct 2004 16:56:54 +0000 |
| Subject: | #30584 [Bgs]: cannot connect to mysql server after sending a number of concurrent requests | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-68400@lists.php.net to get a copy of this message | ||
ID: 30584
User updated by: it at videinfra dot lv
Reported By: it at videinfra dot lv
Status: Bogus
Bug Type: MySQL related
Operating System: Win Server 2003, Win XP Pro
PHP Version: 4.3.9
New Comment:
Initially, I thought it might be MySQL problem. I used the same MySQL
server when I run test on Linux and Win platforms. Settigns in php.ini
on both platforms in MySQL section are the same.
Previous Comments:
------------------------------------------------------------------------
[2004-10-27 18:46:03] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
You are probably reaching the maximum allowed mysql connections on your
MySQL server. This is a MySQL setting you can change.
------------------------------------------------------------------------
[2004-10-27 16:40:56] it at videinfra dot lv
Description:
------------
We met the same problem recently, when we developed a project running
on Win2003. We got cannot connect error when we tested server's
productivity. We used Apache JMeter to simulate 10 concurrent
connections. Initially, we thought that it is because of big amount of
queries we run at the first page. To make sure this is not because of
the number of queries, we created simple PHP script that creates
connection to MySQL, runs simple query like SELECT title FROM pages
WHERE id = 1 and closes connection. The result was the same. We moved
the script and MySQL to a Linux server and repeated the test. We did
not get the error. We repeated the test with PHP on windows and MySQL
on Linux and the error came again. So, when we run PHP script on
windows platform, we got the error everytime irrespective MySQL
location.
Reproduce code:
---------------
<?
$t1 = time();
$conn = mysql_connect ( '10.0.1.4', 'root', '') or die("Could not
connect: " . mysql_error());
mysql_select_db('lub2', $conn);
$res = mysql_query("SELECT title FROM pages_lv0 WHERE id = 1", $conn)
or die("Invalid query: " . mysql_error());
mysql_close($conn);
$t2 = time();
echo $t2 - $t1 . "<br />";
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30584&edit=1