2 years ago
#47591

Tautvydas
Slow filesystem for specific route.name
So suddenly without any deployments in 2 weeks, one route started to be super slow (6-30seconds instead of usual 0.4sec)
I've checked database, redis (cache & sessions on it), restarted them - nothing.
Thought to create a debug route and contoller's method, to check which part causes issues. Started with simple:
Route::get('/random-debug-url/{category}/{slug}', 'ContentController@index')->name('content.index');
Route::get('/{category}/{slug}', 'ContentController@index')->name('content.index.old');
Gone to check the new url (random-debug-url/category/slug) - yeah, still loading slowly. Checked old url (category/slug) - boom, works as fast as always (~400ms). The only difference, that the old route have changed route-name. The new url, has old route name, and it still performs poorly.
Specs: Laravel 8.12, PHP 7.4, Opcache
Newrelic report: https://prnt.sc/26d8mni
It says that in worst case (61s) this took 99.999% of time:
Illuminate\Filesystem\Filesystem::Illuminate\Filesystem\{closure} 7 60,700 ms 100%
Any ideas? How come the same controller/method perform differently just by having different route name?
php
laravel
newrelic
0 Answers
Your Answer