简体   繁体   中英

Symfony 2.8 -> 3.4 local development speed decrease

after upgrading from 2.8 to 3.4.14 we are experiencing way longer pageloads on local development machines (OSX).

load times

simple /login page (cache pre-warmed):

  • nginx+php-fpm app.php: 6 seconds
  • nginx+php-fpm app_dev.php: 10-12 seconds
  • console server:run dev: 10-12 seconds

PHP config

xdebug completely not enabled in php.ini, further config to speed up things:

opcache.enable=1
opcache.memory_consumption=64
opcache.max_accelerated_files=4000
opcache.revalidate_freq=240

profiler data

在此处输入图片说明

在此处输入图片说明

Counting the milliseconds here doesn't get us to the 10 seconds it took to initialize Symfony... right?

Any suggestions on where else to look for the bottleneck?

Thanks a lot,

Kim

Well, this was a weird one. It seems to have been my hosts file and local dns resolution. Once I changed /private/etc/hosts from this

127.0.0.1 localhost
127.0.0.1 myproject.dev
127.0.0.1 myotherproject.dev

to this

127.0.0.1 localhost myproject.dev myotherproject.dev

no delay, from 11 seconds down to 200ms :)

Got this from here .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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