|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-03-21 15:10 UTC] damien at zaide dot org
Description: ------------ Hi, I have installed php on our Windows 2003 Server from 1 or 2 year but we have a recurrent problem. The MySQL connection is very slow, Php is fast but when it use Mysql the performance fall. I have made some research to fix the bug. Firstly think it was a DNS problem because the mysql on not on the localhost but on a remote server (Debian 4.0 with MySQL 5). So i insert the resolv DNS in the host file, but it didn't solve. After this i monitor my MySQL server to check if it come from him, so i make the request to the page on my Win2k3 server and receive the MySQL connection just 5/10 seconds after my request (and 1 or 2 second after my page is printed) ... So the problem is on the Win2k3 side. I have checked if the libmysql.dll is in a directory in the PATH variables. And it was. The sames scripts (PhpBB and other) run very fast on our Linux server, on the same MySQL server asked. If you want me to trace a process, or debug something there is no problem ;) Thanks Reproduce code: --------------- Use a phpbb or a huge php/mysql script Expected result: ---------------- Run quickly Actual result: -------------- The request is very long PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
I have make a very small script and the connection, execution is fast. Everything is fine. Very strange. Here the small script: $db_link = mysql_connect("xxxxx", "user", "pass"); mysql_select_db("database"); $ret = mysql_query("SELECT * FROM zp_options"); while ($tmp = mysql_fetch_array($ret)) print_r($tmp); mysql_close($db_link);I have seting-up the xdebug module on 1 of our production server. I got a big backtrace for the script and i take 16 seconds to get executed. Finally I have see that some operation on files take severals times, like file_exists(), example: 3.2642 1477720 -> file_exists('\\\\192.168.0.1\\windows\\website\\ssp_director\\app\\vendors\\cache_engines/file.php') \\192.168.0.1\windows\website\ssp_director\app\cake\basics.php:621 >=> FALSE 3.4922 1477840 -> file_exists('\\\\192.168.0.1\\windows\\website\\ssp_director\\app\\vendors\\cache_engines/file.php') \\192.168.0.1\windows\website\ssp_director\app\cake\basics.php:623 So this function take 228ms to execute, and the file_exists is executed 30 times so 7 seconds only for this function. Every access to the files on the server seems to be quite slow. Does php for windows use a special lock system who is slow on the samba server?