Livewire is deceptively chatty. The same page that feels like one screen to a user is, on the backend, a stream of POST requests: one per keystroke, click, and validation. That changes what monitoring has to do: the question stops being "is this route slow" (every interaction hits the same route) and becomes "which component is slow, and how often is the user actually waiting on it." A standard request dashboard answers the first question and buries the second.
Why Livewire needs its own monitoring lens
Every user interaction (typing in a search box, clicking a checkbox, validating a field) is a POST to /livewire/update (/livewire-{hash}/update in Livewire 4). A moderately interactive Livewire page can generate 10-50 backend requests per user-minute. That makes two things matter more than usual:
- Per-component aggregation: per-route grouping is useless because every request hits the same route. You care which component is slow.
- Latency targets: users expect UI to feel reactive. A checkbox toggle that takes 300ms feels laggy; a full page load at 300ms feels fine.
Finding slow components
Your APM sees every Livewire interaction as a POST to the same update endpoint. To find the slow ones, parse the request payload, which includes the component name:
Livewire 3 request shape (simplified)
{
"components": [
{
"snapshot": "{\"data\":{...},\"memo\":{\"id\":\"abc123\",\"name\":\"products.filter-panel\",...},\"checksum\":\"...\"}",
"updates": { ... },
"calls": [{ "method": "updateFilter", "params": [...] }]
}
]
}
Decode components[].snapshot (it's a JSON string) and read memo.name. That's the component's alias (products.filter-panel for App\Livewire\Products\FilterPanel), the value you want to group on.
Common Livewire performance bugs
N+1 inside render()
// Bad: render() fires on every interaction, each one refetches posts
public function render()
{
return view('component', [
'users' => User::all(), // 1 query
// Users->posts in template fires N queries per render
]);
}
// Good: eager-load
public function render()
{
return view('component', [
'users' => User::with('posts')->get(),
]);
}Unbounded real-time search
// Bad: wire:model.live sends a request as the user types,
// with only a 150ms default debounce between them.
public $search = '';
// <input wire:model.live="search">
// Good: debounce, wait for pause
// In Blade:
// <input wire:model.live.debounce.300ms="search">
// Better: only update on blur for expensive filters
// <input wire:model.blur="search">Computed properties without caching
// Bad: recomputes on every update request
public function getCartTotalProperty()
{
return $this->cart->items->sum('price'); // hits DB each time
}
// Good: memoize per component instance across requests.
// (cache: true would share one value across every user.)
// Call unset($this->cartTotal) after the cart changes.
use Livewire\Attributes\Computed;
#[Computed(persist: true, seconds: 5)]
public function cartTotal()
{
return $this->cart->items->sum('price');
}Latency targets
| Interaction | p95 target | Feels laggy above |
|---|---|---|
| Toggle / checkbox | < 100ms | 200ms |
| Form validation | < 150ms | 300ms |
| Filter / search | < 300ms | 500ms |
| Submit / save | < 500ms | 1000ms |
For interactions you can't get below 200ms, use wire:loading indicators. A visible spinner or disabled state masks the latency.
Instrumenting lifecycle events
app/Providers/AppServiceProvider.php
use Livewire\Livewire;
public function boot(): void
{
// Livewire 3 lifecycle events
Livewire::listen('mount', function ($component, $params) {
logger()->info('Livewire mount', [
'component' => $component::class,
'params' => array_keys($params),
]);
});
Livewire::listen('hydrate', function ($component) {
// Runs on every update request: attach timing info, user context, etc.
});
}