简体   繁体   English

在Windows / IIS 7与Linux / Apache之间运行PHP的性能差异?

[英]Performance differences running PHP under Windows/IIS 7 vs. Linux/Apache?

There is a PHP application right now on a Linux box running under Apache with MySQL. 现在,在带有MySQL的Apache下运行的Linux机器上有一个PHP应用程序。 Since we are a windows shop, management wants to get rid of the Linux box and move everything over to windows. 由于我们是一个Windows商店,管理层希望摆脱Linux框并将所有内容移至Windows。 Is there a performance difference between the two platforms? 两个平台之间是否存在性能差异? Or, is there any significant difference at all, in terms of performance or management? 或者,在绩效或管理方面是否有任何重大差异?

Microsoft had a team help out optimising PHP for Windows, which work is part of PHP 5.3. 微软有一个团队帮助优化PHP for Windows,这是PHP 5.3的一部分。 Some figures I've seen places the performance close to PHP + Apache on a unix system. 我见过的一些数据表明,在unix系统上,性能接近PHP + Apache。 Before 5.3 (Which means currently, since 5.3 isn't out yet), performance is bad on Windows. 在5.3之前(这意味着目前,因为5.3还没有出来),Windows上的性能很差。 I think there are some patches and tricks you can pull to improve it, but it's going to cost you a bit of performance. 我认为你可以通过一些补丁和技巧来改进它,但它会让你失去一些性能。 That may or may not be a problem; 这可能是也可能不是问题; People have a tendency to overestimate performance. 人们倾向于过高估计绩效。

Note that there are other reasons to use unix than just performance. 请注意,使用unix还有其他原因而不仅仅是性能。 Code may not be portable and even though the core php runs fairly ok, you can well get into trouble with php-extensions and third party libraries. 代码可能不是可移植的,即使核心php运行相当正常,你也可能遇到php扩展和第三方库的问题。 No matter how you look at it, Windows is a second-rate system for running php on. 无论你怎么看,Windows都是运行php的二流系统。

If your application isn't huge or get hit a couple thousand times per second, there's no difference between the two. 如果您的应用程序不是很大或每秒被击中几千次,那么两者之间没有区别。 LAMP == WAMP in php small projects. LAMP == WAMP在php小项目中。 Just install something like XAMPP if you want your environment to be as close as possible to your existing one but in Windows. 如果您希望您的环境尽可能接近现有环境,只需在Windows中安装XAMPP

Good luck with your project! 祝你的项目好运!

You should consider the MS WebPI (download at www.microsoft.com/web ) which would install the entire stack for you to run PHP in IIS7 environment. 您应该考虑MS WebPI(在www.microsoft.com/web下载),它将安装整个堆栈,以便您在IIS7环境中运行PHP。

the performance is comparable for most apps. 大多数应用程序的性能都相当。

I've just done this for the same reason. 我出于同样的原因这样做了。 Mgt wanted to get rid of the Linux box. 管理员想要摆脱Linux盒子。 I was able to completely move my php application and MySQL database. 我能够完全移动我的php应用程序和MySQL数据库。 It took longer for me to configure PHP for IIS than it did for me to move the existing content over. 我为IIS配置PHP所需的时间比移动现有内容的时间要长。 I have found though that the IIS server is a fair bit slower when it comes to loading pages and images. 我发现虽然在加载页面和图像时IIS服务器的速度要慢一些。 Where in Linux it appeared instantaneous, in IIS it takes a half second for the page to load and another second for images. 在Linux中,它似乎是即时的,在IIS中,页面加载需要半秒钟,图像需要另外一秒钟。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM