Symfony Slow on Windows

Symfony Slow on Windows

  1. IPv4 problem:

    • use localhost instead for database connection or any other connection
  2. realpath_cache_size

Remove JMS DI Extra bundle can do this on windows if not configured properly.

  1. php.ini realpath_cache_size=5M realpath_cache_ttl=600 open_basedir=

[opcache] opcache.memory_consumption=256 opcache.max_accelerated_files = 20000 opcache.validate_timestamps=0

  1. mysql

innodb_buffer_pool_size = 384M innodb_additional_mem_pool_size = 20M innodb_log_file_size = 10M innodb_log_buffer_size = 64M innodb_flush_log_at_trx_commit = 1 innodb_lock_wait_timeout = 180

User stories:

  • I finally walked through Symfony starting up in xDebug and found that the dev cache was being rebuilt every single page request and that the file services.yaml was triggering the cache rebuild.

When I looked at the Services.yaml file I realized that the modified time was way in the future, because I was testing time changes and had moved my computer time into the future and saved the services.yaml file during that. When I re-saved the file in the current time it stopped forcing the cache to be rebuilt every time.

Symfony Cache

When changes on entity are not noticed, any of the following works, but the fastest is:

php bin/console doctrine:cache:clear-metadata

Everything cache:

php bin/console cache:clear

Just clear Doctine cache:

php bin/console doctrine:cache:clear-result php bin/console doctrine:cache:clear-query php bin/console doctrine:cache:clear-metadata

date 01. Jan 0001 | modified 10. Jun 2024
filename: Temp » Symfony