markjoe Posted July 24, 2007 Share Posted July 24, 2007 Had a PHP site on an old server: 1x 800Mhz (maybe dual CPU I'm not sure, but does it matter?) 2GB RAM Windows Server 2003 - IIS - PHP 5.2.1 Transfered site to new server: 2x 3Ghz CPU 2GB RAM Windows Server 2003 - IIS - PHP 5.2.3 Reports that took 3 minutes on old server take 5 minutes on new server. The specific page tested has 3 main parts: -Scan directory over the network and insert into MySQL DB. -Read 200k text file from local drive line by line and insert into MySQL DB. -Read 10k text file from local drive line by line and insert into MySQL DB. I didnt save the test results, but were talking 25 seconds compared to 140 seconds for the first 2 parts individually. This is with identical code on both machines. I disabled the MySQL inserts for the testing, so this is the PHP processing alone. The new machine is on a different switch, but, still on the same subnet as the old machine, so network conditions should be the same. It's even dual NIC, old was single. I'm no expert, and very new to IIS (touched it 3 times). Getting rid of IIS is not an option, it's on a corporate network. PHP is installed as ISAPI module. Have tried with output_buffering On and Off, no difference. Any other info that would be helpfull let me know. Here is the code that does the 200k file, keep in mind it's the same code on old server. $spotlist = file ($fairview1spotlist); if (!$spotlist) { echo "could not open spotlist file: " . $fairview1spotlist; } foreach($spotlist as $spotid) { if (substr($spotid,-8,2) != "_p") { $spotid = substr($spotid,0,(strlen($spotid)-6)); //remove file extention while(strlen($spotid) < 12) { $spotid = "0" . $spotid; //left pad 0 until 12 char long } $query = "insert into spotlist values ('$spotid')"; //$result = mysql_query($query); if ($result) { $spotcount ++; } } } Quote Link to comment https://forums.phpfreaks.com/topic/61594-solved-crazy-slow-php-execution-on-new-server/ Share on other sites More sharing options...
markjoe Posted July 25, 2007 Author Share Posted July 25, 2007 UPDATE: Uninstalled SP2 on new server since old one didn't have it - no change. Downgraded to PHP 5.2.1 from 5.2.3 on new server, to match old server - no change. Pulled out the Ouiji board, burned some sweet grass and danced around the server - no change. Quote Link to comment https://forums.phpfreaks.com/topic/61594-solved-crazy-slow-php-execution-on-new-server/#findComment-306864 Share on other sites More sharing options...
markjoe Posted August 1, 2007 Author Share Posted August 1, 2007 Can anybody even recomend a better place to find help with this? We wiped the server and re-installed Server2003 without out IIS. Installed WAMPserver5. Same problem. Oh and the same thing happens when accessing from/to localhost. Quote Link to comment https://forums.phpfreaks.com/topic/61594-solved-crazy-slow-php-execution-on-new-server/#findComment-312412 Share on other sites More sharing options...
markjoe Posted August 2, 2007 Author Share Posted August 2, 2007 I am still very confused as to why this happened, but the problem is now fixed. Quote Link to comment https://forums.phpfreaks.com/topic/61594-solved-crazy-slow-php-execution-on-new-server/#findComment-313753 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.