Performance
Performance monitoring tells you which pages of your application are slow and where the N+1 queries are. It also shows, in plain words, the slow SQL queries, the jobs that take time and the external services that answer badly. It warns you once when a problem appears, and closes the alert when it goes away.
It is included in the Indie and Studio plans, and during the beta. The Free and Solo plans do not have it.
How it measures
The Laravel client package runs no SQL query and sends nothing during your visitors' requests. Each HTTP request and each job appends one compact line to a file on your disk; once a minute, a single task adds that file up and sends us one summary. Everything is measured, with no sampling, so the figures are right even on a small site.
For the past minute, the summary carries:
- per page or action: the route name (or its address pattern,
users/{user}, never the address visited), the number of calls, the 5xx answers, the durations and their distribution, the number and time of SQL queries; - per notable SQL query (the most costly, the N+1, the runs of at least one second): its shape, without any value, and the page or job that ran it;
- per external service called with Laravel's HTTP client: its host name alone, the number of calls, the failures, the durations;
- per job: its class, its queue, the number of runs, the failures, the durations.
No user identifier, no IP address, no request body or header is part of it.
What the server does on arrival
We trust no client. On reception:
- every text is rewritten into a strict character set; a control or formatting character is replaced;
- an address segment of 20 characters or more (a token, a signed identifier) becomes
{secret}; - an IP address, public or private, becomes
adresse-ip, and a host name loses its user and its port; - every SQL query is normalised again (every string and number becomes
?) then passed through the full masking (emails, IBAN, cards, API tokens...) before it is stored; - the hour kept is the hour of reception, never your server's clock.
A summary sent again after a cut connection is never counted twice.
Turning it on
In the .env of the monitored application, with the quiet-guard/laravel-monitor package at version 0.10.0 or later:
MONITOR_PERFORMANCE=trueBy default only the production environment is measured (MONITOR_PERFORMANCE_ENVIRONMENTS). The package needs a writable, persistent directory (storage/framework/quiet-guard/performance by default): on a read-only disk, measuring turns itself off. Avoid a network disk (NFS).
If you use php artisan config:cache, run it again after editing the .env. The summary leaves from Laravel's scheduler; without a scheduler, it leaves with the first request of each new minute.
The problems detected
Every hour, we read the last 24 hours again:
| Problem | Opened when, over 24 hours |
|---|---|
| Slow page | at least 20 calls, at least 3 calls slower than your threshold, and more than 5 % of calls above it |
| N+1 | at least 3 page views where the same SELECT query, for the same page, runs in a loop |
| Slow SQL query | at least 3 runs of one query of at least one second |
| Failing external service | at least 20 calls and at least 20 % failures |
The slow-page threshold is 1,000 ms by default and is set per project among 300, 500, 750, 1,000, 1,500, 2,000 and 3,000 ms. "Slower than the threshold" means strictly above.
A problem closes after three passes in a row where the last three hours that had traffic are clean (under 3 % of slow calls for a page). A detection therefore does not outlive its fix by a day.
There is no error-rate detection and no failed-job detection: an error is already an issue, with its own alert.
At most 20 problems are open at once per project.
Ignoring
From the project's Performance page, a problem can be ignored for 7 days or ignored for good: it closes, and neither reopens nor alerts until then.
Alerts
A pass that opens problems sends one alert per project, listing them all, under the key performance.degraded: in every member's bell, and on the channels that have it ticked (see Alerts). Existing channels do not get it automatically: tick it.
An alert carries only the label (the page, the service, the job), the figures and the link. Never the text of an SQL query: it is visible in the dashboard only.
For the first 24 hours after the first summary arrives, nothing is sent: the page already shows the problems, the channels wait for the figures to have some history.
Retention
Measurements are kept per hour for 48 hours, then grouped per day in the next nightly pass (so after two to three days) and kept for your plan's retention. Past 10 environments, 200 pages, 300 SQL queries, 50 services and 100 jobs per period, the rest is counted in an "other" row; when grouping per day, the most costly keep their row.
These aggregates stay in clear, even for a team that turns on encryption, like an issue's class, file and line. They are not part of the team's data export.
Limits
- Only calls made with Laravel's HTTP client (
Http::) are seen; an SDK with its own client is not. CallQueuedListenerandSendQueuedMailablegroup every queued listener and every queued mail under their own name.- Two SQL queries whose first 500 characters are identical are counted together.
- A value carried by a table, schema or alias name (
client_dupont.users) is not recognised as a value. - The cache, mails, notifications, Artisan commands and the scheduler are not measured.
You are reading the Quiet Guard v1.0 documentation.