Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since version 4.14.0 router reload config from Yaml at each request #6506

Closed
jderusse opened this issue Nov 5, 2024 · 2 comments · Fixed by #6515
Closed

Since version 4.14.0 router reload config from Yaml at each request #6506

jderusse opened this issue Nov 5, 2024 · 2 comments · Fixed by #6515
Labels
Milestone

Comments

@jderusse
Copy link

jderusse commented Nov 5, 2024

Describe the bug

Since we upgraded to version 4.14.0, we noticed a performance degradation in application monitoring.

Digging into the issue leads to routing's YamlLoader called at each request (like cache is ignored)

To Reproduce

Call any page to warm the cache.
Reload the page (any, it does not matter if it's handled by EasyAdminBundle) and check if YamlLoader is called.

ie. edit vendor/symfony/routing/Loader/YamlFileLoader.php to add dd('here'); on top of load function.

(OPTIONAL) Additional context

Here is a callstack


#0 /app/vendor/symfony/config/Loader/FileLoader.php(163): Symfony\Component\Routing\Loader\YamlFileLoader->load()
#1 /app/vendor/symfony/config/Loader/FileLoader.php(83): Symfony\Component\Config\Loader\FileLoader->doImport()
#2 /app/vendor/symfony/routing/Loader/Configurator/RoutingConfigurator.php(41): Symfony\Component\Config\Loader\FileLoader->import()
#3 /app/src/Kernel.php(41): Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator->import()
#4 /app/vendor/symfony/framework-bundle/Kernel/MicroKernelTrait.php(210): AdminPipeline\Kernel->configureRoutes()
#5 /app/vendor/symfony/routing/Loader/ObjectLoader.php(55): AdminPipeline\Kernel->loadRoutes()
#6 /app/vendor/symfony/config/Loader/DelegatingLoader.php(37): Symfony\Component\Routing\Loader\ObjectLoader->load()
#7 /app/vendor/symfony/framework-bundle/Routing/DelegatingLoader.php(65): Symfony\Component\Config\Loader\DelegatingLoader->load()
#8 /app/vendor/symfony/framework-bundle/Routing/Router.php(67): Symfony\Bundle\FrameworkBundle\Routing\DelegatingLoader->load()
#9 /app/vendor/easycorp/easyadmin-bundle/src/EventListener/AdminRouterSubscriber.php(71): Symfony\Bundle\FrameworkBundle\Routing\Router->getRouteCollection()
#10 /app/vendor/symfony/event-dispatcher/Debug/WrappedListener.php(115): EasyCorp\Bundle\EasyAdminBundle\EventListener\AdminRouterSubscriber->onKernelRequestPrettyUrls()
#11 /app/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke()
#12 /app/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#13 /app/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php(122): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#14 /app/vendor/symfony/http-kernel/HttpKernel.php(159): Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
#15 /app/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#16 /app/vendor/symfony/http-kernel/Kernel.php(182): Symfony\Component\HttpKernel\HttpKernel->handle()
#17 /app/public/index.php(25): Symfony\Component\HttpKernel\Kernel->handle()

side note: router->getRouteCollection() is not cached. Frameworkbundle's RouteMatcher and RouteGenerators are.

@javiereguiluz
Copy link
Collaborator

Thanks for reporting. I haven't looked into this yet ... but in #6499 we merged a bug that also introduced a big performance improvement when generating routes with pretty URLs.

I'll try to debug the issue that happens here.

@javiereguiluz
Copy link
Collaborator

I think that this could be fixed in #6515.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants