简体   繁体   English

PHP Phar部署性能

[英]PHP Phar Deployment Performance

I am considering architecting our php app's deployment process such that the build's output produces a single phar archive for the necessary code to run the app in production. 我正在考虑设计php应用程序的部署过程,以便构建的输出生成单个phar存档,以存储在生产环境中运行该应用程序所需的代码。 I am wondering about the performance of deploying a web app in this way versus the traditional model of checking out or copying the source tree itself to the document root for the web-server. 我想知道与以传统方式签出或将源树本身复制到Web服务器的文档根目录的传统模型相比,以这种方式部署Web应用程序的性能如何。

There are benefits to the packaged approach in that the package can be fully prepped by the CI server (removing test code for example) and then a single archive just copied to the server for deployment. 打包方法的好处在于,可以由CI服务器完全准备好该程序包(例如,删除测试代码),然后将单个存档仅复制到服务器以进行部署。 The pristine archives can be stored in a repository as well. 原始档案也可以存储在存储库中。

I don't want to use this approach if running the app as a phar will cause a bottleneck however. 但是,如果将应用程序作为Phar运行会导致瓶颈,我不希望使用这种方法。 Are there issues with loading the source out of the phar? 将源从phar中加载是否有问题? The app uses autoloading via composer to load source. 该应用程序通过Composer使用自动加载功能来加载源。

I benchmarked a application back in 2011; 我在2011年对应用程序进行基准测试 speed was not an issue with phar. 速度不是phar的问题。

There will be minor problems loading source code and template files - depending on how you do it currently. 加载源代码和模板文件会遇到一些小问题-取决于您当前的操作方式。 But all in all, this won't be impossible problems. 但总而言之,这不会是不可能的问题。

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

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