F
Filament9mo ago
Léo

Performances issues when Filament goes in production

Hello, I have an API that does real time on a specific domain. On this laravel application I've added filament on another specific domain to be able to monitor events. For the moment, the filament panel is empty, there's nothing in it, just a blank page. It worked fine, but when I put it into production I noticed a 250% increase in memory, -50% requests per instance. We process around 5-6k req/s usually. I suspect that the service provider is being called for each request even though it has nothing to do with it as the filament.x.com domain is not being called. Do you have any ideas? Do you think it's possible that the service provider is doing greedy calculations every time laravel calls its service providers even though I've specified that the domain isn't concerned? What are your recommendations ?
No description
7 Replies
toeknee
toeknee9mo ago
How are you calling the API? does the API run only on the API Route?
Léo
LéoOP9mo ago
thanks for reply @toeknee ! yes all endpoints uses api routes on api.x.com/api/vx/....... filament is served on filament.x.com/ not api.x.com/admin/ here my provider
return $panel
->id('pantry')
->domain(config('admin.domain'))
->default()
->authGuard('web')
->login()
->colors([
'primary' => Color::hex('#0041d9'),
])
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Admin/Widgets'), for: 'App\\Filament\\Admin\\Widgets')
->widgets([])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
return $panel
->id('pantry')
->domain(config('admin.domain'))
->default()
->authGuard('web')
->login()
->colors([
'primary' => Color::hex('#0041d9'),
])
->discoverResources(in: app_path('Filament/Admin/Resources'), for: 'App\\Filament\\Admin\\Resources')
->discoverPages(in: app_path('Filament/Admin/Pages'), for: 'App\\Filament\\Admin\\Pages')
->pages([
Pages\Dashboard::class,
])
->discoverWidgets(in: app_path('Filament/Admin/Widgets'), for: 'App\\Filament\\Admin\\Widgets')
->widgets([])
->middleware([
EncryptCookies::class,
AddQueuedCookiesToResponse::class,
StartSession::class,
AuthenticateSession::class,
ShareErrorsFromSession::class,
VerifyCsrfToken::class,
SubstituteBindings::class,
DisableBladeIconComponents::class,
DispatchServingFilamentEvent::class,
])
->authMiddleware([
Authenticate::class,
]);
toeknee
toeknee9mo ago
use telescope to debug the API Request and see what's booting into it,
Léo
LéoOP9mo ago
@toeknee with telescope i can confirm that one request on api.x.com/api/vx/ use more ressources on a health endpoint with Filament Memory usage 48.5 MB without Filament Memory usage 44 MB :/
toeknee
toeknee9mo ago
It will, but what happens when you stack trace it down
Léo
LéoOP9mo ago
I don't have any other stack traces apart from sql queries which have nothing to do with filament. no http calls, no views, no cache related to filament I suspect some processing was done in the filament service provider independent of the domain (maybe its the goal ?)
No description
Léo
LéoOP9mo ago
@toeknee
Want results from more Discord servers?
Add your server