PHP 5.5性能windows vs linux。为什么这么不同?

时间:2014-09-29 10:23:08

标签: php linux performance azure benchmarking

我已经测试过这个基准测试脚本http://www.php-benchmark-script.com/ 在Linux和Windows机器上。是的。更好地测试相同的硬件,但我不能。

差异非常有趣。我从命令行运行php:

共享托管:

Xeon E5-2680 v2 @ 2.80GHz
PHP version : 5.5.17
Platform : Linux
--------------------------------------
test_math                 : 0.989 sec.
test_stringmanipulation   : 1.006 sec.
test_loops                : 0.587 sec.
test_ifelse               : 0.487 sec.
--------------------------------------
Total time:               : 3.069 sec.

我的本地计算机:

i5 3570К 3.4 (overclock to 3.7Ghz)
PHP version : 5.5.17
Platform : WINNT (win7-64)
--------------------------------------
test_math                 : 0.838 sec.
test_stringmanipulation   : 1.984 sec.
test_loops                : 0.622 sec.
test_ifelse               : 0.394 sec.
--------------------------------------
Total time:               : 3.838 sec.

Windows AZURE Standard_A2(2核,3,5 RAM)

PHP version : 5.5.17
Platform : WINNT
--------------------------------------
test_math                 : 2.117 sec.
test_stringmanipulation   : 4.591 sec.
test_loops                : 1.949 sec.
test_ifelse               : 1.436 sec.
--------------------------------------
Total time:               :10.093 sec.

Windows AZURE网站免费

PHP version : 5.5.14
Platform : WINNT
--------------------------------------
test_math                 : 2.238 sec.
test_stringmanipulation   : 4.485 sec.
test_loops                : 1.874 sec.
test_ifelse               : 1.292 sec.
--------------------------------------
Total time:               : 9.889 sec.

为什么Linux对PHP的速度要快得多? Xeon E5-2680 v2 @ 2.80GHz只是魔法处理器吗?

0 个答案:

没有答案