symfony is slow
博客专区 > jims 的博客 > 博客详情
symfony is slow
jims 发表于2年前
symfony is slow
  • 发表于 2年前
  • 阅读 42
  • 收藏 1
  • 点赞 0
  • 评论 0

腾讯云 新注册用户 域名抢购1元起>>>   

Since PHP 5.5 has now integrated the PHP OPCache, this speeds up the execution time. In my setup a full request with database access takes 180ms now.

Steps:

  1. Update to the latest php version

  2. Enable OPCache

  3. Disable xdebug

  4. Set realpath_cache_size = 2M as DemonTPx mentioned

php.ini settings:

realpath_cache_size = 2M 
[XDebug] 
xdebug.profiler_enable = 0 
xdebug.remote_enable = 0 
[opcache] 
zend_extension = "C:\xampp18\php\ext\php_opcache.dll" 
opcache.enable = 1 
opcache.enable_cli = 0 
opcache.memory_consumption = 128 
opcache.interned_strings_buffer = 8 
opcache.max_accelerated_files = 4000

Why is Windows slower than Unix?

As discussed here, PHP is very slow in file_exists, and filemtime() on Windows. since Symfony2 is using these functions in dev mode a lot. we won't get under 700ms (in <= 5.4) on Windows. PHP 5.5 allows now 180ms.

A solution could be WinCache which was developed by microsoft to solve this problem on IIS. But as it only works on several Windows versions and also only with IIS it's no solution for me.

Alternative

Also a nice solution I can recommend is to have a Linux Virtual Machine on Virtualbox. This is easy to setup and is also more like the production environment.


http://stackoverflow.com/questions/9854848/windows-7-php-symfony2-terribly-slow

共有 人打赏支持
粉丝 4
博文 108
码字总数 29249
×
jims
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: