F
Filament3mo 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
toeknee3mo ago
How are you calling the API? does the API run only on the API Route?
Léo
Léo3mo 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
toeknee3mo ago
use telescope to debug the API Request and see what's booting into it,
Léo
Léo3mo 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
toeknee3mo ago
It will, but what happens when you stack trace it down
Léo
Léo3mo 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éo3mo ago
@toeknee
Want results from more Discord servers?
Add your server
More Posts
Form validation messagesI have a simple form in Filament v3, but the validation errors shows as a default browser message (smake export file download when we run queue:work command and csv file is generatedHi! i want to make my csv file download whenever i run queue:work command and also store the path ofFilament widget on click show table list recordIs it possible to make the widget clickable so that when you click it, it redirects you to a resourcTyped static property error when trying to activate cluster functionalityI'm trying to use the cluster functionality but I'm running into an error I can't get past. The clusHow to collapse section on button clickI have a livewire component that is rendering the form I want that when form is submited I collapse using @livewireScriptConfig instead of @filamentScriptsI'm using the tables package in livewire components. I'm using an extra Alpine plugin. So followingHow do custom field : Dynamic datalist + Input arrayHello, I try to migrate my old backend to filament. The last thing I need to do is the one in the viCan I defer uploading via the FileUpload component until form submissionI'm using Filament's file upload component in my form within my livewire component: https://filamentHow to attach and detach a relation in case there were valuesMy resource **may** has One to One (Polymorphic) relationship with Review, I want to create a reviewLogout action in a livewire componentI'm using the actions as a Livewire component to display a Sidepanel. However trying to figure out o