ID: 47712 Updated by: and...@php.net Reported By: ninzya at inbox dot lv Status: Feedback Bug Type: MySQL related Operating System: Windows XP PHP Version: 5.3.0RC2 Assigned To: mysql New Comment:
The only change I did was to switch off the zval caching code so every time a zval is needed a new one is created by Zend instead of using our cache. Previous Comments: ------------------------------------------------------------------------ [2009-06-09 09:53:12] and...@php.net Hi, maybe it is, I think it should be. I did not rely on phpt for testing. I just put it on a Apache2 MPM, Linux, and ran 2 million requests, concurrency of 150, thread-safe build. I asked ab to run with verbosity of 2, and logged the output to a file. Then I did a grep on Conten-Length, then I uniq-ued and sorted the results. Just 5 results. One is correct, others were the errors because of exhausted resources. ------------------------------------------------------------------------ [2009-06-08 13:52:46] ninzya at inbox dot lv I have just tested my code on linux machine and got no problems. Seems this bug affects only windows build. I have downloaded latest available PHP 5.3.0RC3 snap from snaps.php.net (PHP 5.3.0RC3-dev (built: Jun 8 2009 14:06:20)), the bug is gone now. If this is your patched snap, then seems you have found the issue. If not, mayble the solar activity has decreased (we're lucky and the bug was fixed by another dev). Anyway, i'm glad it's working now. ------------------------------------------------------------------------ [2009-06-08 13:26:07] ninzya at inbox dot lv Hello, Andrey. Well, the script you are using is not exactly the same i have provided. Try testing for values of $row keys, see if the contained data is the data you expect, as i did in my case. Do not rely on PHPT, try benchmarking locally. I will try my code on linux machine and report in a couple of minutes. ------------------------------------------------------------------------ [2009-06-08 13:17:46] and...@php.net Just tried again. 2 million requests, concurrency of 150, which led to load of 90 on the box - pretty hefty, where a problem should show itself and again no problem except that in some cases connection to MySQL couldn't be established, which is to be expected. MySQL was set up to have 1000 maximal connections, so it is not the bottleneck, just system resources. ------------------------------------------------------------------------ [2009-06-08 12:46:49] and...@php.net Hi, I switched on the zval cache and tried to reproduce the problem, with no success. I tested with Apache2 MPM. `ab` concurrency level starting from 20 up to 100. Time from 30 to 45 seconds. I got, with your code, only 3 types of errors. I added mysql_connect() myself - mysql_connect() fails because cannot have more connections on the unix socket. Using TCP/IP exhausts the resources earlier for connecting to MySQL - mysql_query() tries to connect, although the connection has failed, typical for mysql_query()! It fails : -- password problem -- no resources I did not see any corruption whatsoever. Difference from you is that I tested on Linux, as server. ab was running on a Mac connected over a FastEthernet switch. Here follows the code I used: <?php $conn = mysql_connect("localhost", "root", "root"); mysql_select_db("test"); $result = mysql_query("SELECT a,b FROM stress_test"); if (!$result) { echo 'Could not run query: ' . mysql_error(); exit; } /* Use the result, assuming we're done with it afterwards */ $row = mysql_fetch_assoc($result); /* Now we free up the result and continue on with our script */ mysql_free_result($result); var_dump($row); ?> ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/47712 -- Edit this bug report at http://bugs.php.net/?id=47712&edit=1