Filament gives you a production admin panel in an afternoon, which is exactly why its performance problems sneak up on you. Nobody profiles the admin: it's for staff, and it feels instant on a dev machine with fifty seed rows. Then the users table grows to a hundred thousand rows, a column closure runs its own query for every row on the page, and the list that used to open instantly takes seconds. The panel is a Laravel app underneath, so the fixes are ordinary Laravel fixes once you can see where the time goes.
Table resources: the biggest performance trap
A Filament Resource renders a Livewire-powered table. Filament eager-loads the relationships you name with dot notation (company.name), so those columns don't cause N+1. The trap is a column that computes its value in a closure, because the closure runs once per row:
Bad: fires one query per row
class UserResource extends Resource
{
public static function table(Table $table): Table
{
return $table->columns([
TextColumn::make('name'),
TextColumn::make('company.name'), // eager-loaded by Filament
TextColumn::make('orders_total')
->state(fn (User $record) => $record->orders()->sum('total')), // N+1
TextColumn::make('subscription_plan')
->state(fn (User $record) => $record->subscription?->plan), // lazy-load per row
]);
}
}Good: aggregate in SQL, eager-load what closures touch
use Filament\Tables\Columns\TextColumn;
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
class UserResource extends Resource
{
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn (Builder $query) => $query->with('subscription'))
->columns([
TextColumn::make('name'),
TextColumn::make('company.name'),
TextColumn::make('orders_sum_total')->sum('orders', 'total'),
TextColumn::make('subscription_plan')
->state(fn (User $record) => $record->subscription?->plan),
]);
}
}
For complex tables with counts, use withCount() instead of computing in the view. Aggregate columns should be SQL-side whenever possible.
Widget caching
Filament widgets re-render on page load and on every $pollingInterval tick (5s by default). Uncached queries run every time:
class TotalRevenueWidget extends StatsOverviewWidget
{
// Filament v4/v5. On v3 the property is static.
protected ?string $pollingInterval = '30s';
protected function getStats(): array
{
// Bad: hits DB every 30s
// $total = Order::where('paid', true)->sum('total');
// Good: cached
$total = Cache::remember('stats.total_revenue', 30, fn () =>
Order::where('paid', true)->sum('total')
);
return [
Stat::make('Revenue', '$' . number_format($total, 2)),
];
}
}Admin auth failure tracking
/admin is a high-value target for attackers. Track failed logins. Filament's login form is a Livewire component, so a failed attempt arrives on the Livewire update endpoint, not on /admin/login: a check on the request path never matches. Log every failure with its guard instead, and filter on the guard if your panel has its own (->authGuard('admin')):
app/Providers/AppServiceProvider.php
use Illuminate\Auth\Events\Failed;
use Illuminate\Support\Facades\Event;
public function boot(): void
{
Event::listen(function (Failed $event) {
logger()->warning('Login failure', [
'guard' => $event->guard,
'email' => $event->credentials['email'] ?? null,
'ip' => request()->ip(),
'ua' => request()->userAgent(),
]);
});
}Watch these logs for failed-login spikes per IP. Filament's login page already rate-limits attempts (5 per minute); add IP-allowlisting at the load balancer where you can.
What to track per resource
- List page load: should be < 400ms p95 for admin usability
- Row actions: edit / delete / bulk. Target < 300ms per Livewire update.
- Form submit: complex forms with many fields can be slow on save. Profile the Resource model's save() path.
- Bulk actions: users expect these to be reasonably fast. If bulk is slow (> 2s for 50 rows), queue them instead.
Filtering your APM to admin traffic
In most APMs, filter requests by URL prefix:
- /admin/*: full panel page loads
- /livewire/update (/livewire-{hash}/update in Livewire 4): table filters, actions, form field updates, form submits and login submits
- /admin/login: login page loads