Performance Debugger for Magento 2
A free request profiler for Magento 2. When you start a profiling session from the admin, a storefront toolbar shows how long blocks, observers, layout and database queries took, and flags slow, duplicate and N+1 queries. Other visitors are not recorded unless Allowed IP Addresses is set to *.
- Free
- Themes listed: Hyvä + Luma
- Package requirementsRead the source documentation
- Developer profileView Upwork profile
- Themes listedHyvä + Luma
- PHP versions listed8.1, 8.2, 8.3, 8.4
- Installation questionsDiscuss your store setup
What it does for your store
The main features, as listed in the module documentation.
-
Per-request timings
Records controller, layout, block, observer and query events with their duration, plus total time and peak memory.
-
Opt-in capture only
Profiles a browser only after an admin starts a signed profiling session, or a client IP you allow. Other visitors keep cached pages.
-
Bottleneck findings
Flags duplicate and N+1 queries, slow queries, blocks and observers, and heavy modules, each with a severity and a suggested fix.
-
Saved runs and exports
Stores runs for the admin Profiler Runs grid, with an XLS download and a print-ready report you can save as PDF.
-
Redacted query data
String literals in SQL and non-numeric bind values are masked before anything is stored or shown.
Listed requirements
These are the details supplied in this listing. Confirm the selected release supports your Magento edition, PHP and storefront.
| Magento versions listed | 2.4.6, 2.4.7, 2.4.8 |
|---|---|
| PHP versions listed | 8.1, 8.2, 8.3, 8.4 |
| Themes listed | Hyvä, Luma |
Documentation
Product details and setup guidance. Check the package repository for release-specific instructions.
Overview
Performance Debugger (Panth_PerformanceDebugger) is a request profiler for Magento 2. It times the work done inside one storefront request: every block render, event dispatch, layout generation step, controller dispatch and database query. It then lists what was slow and shows the result in a floating toolbar on the page you are looking at.
It is a developer tool. It changes no storefront behaviour: its plugins on core framework classes only measure and return the original result. Use it while you profile, then switch it off.
What it records
- Events of the kinds controller, layout, block, observer and query, each with its duration in milliseconds, a label and a source.
- Total wall-clock time from the start of
Http::launchand the peak memory of the request. - Database queries with a normalised fingerprint, so repeated queries group together even when their values differ, and a short call trail.
- Findings for duplicate queries (shown as N+1 when the SQL looks like a single-row lookup), slow queries, slow blocks, slow observers and heavy modules, each with a severity, an explanation, a suggested fix and an estimated saving.
- A split between your own code (
app/code,app/designand non-Magento vendor packages) and Magento core, so core findings are shown separately for information.
The Track Plugins and Track DI Resolution settings exist, but no collector records plugin or DI events, so they have no effect.
Storefront toolbar
The toolbar has the tabs Overview, Timeline, Queries, Modules, Issues, Fix it and Core, with text filters and copy buttons for SQL and fix snippets. It is plain inline HTML, CSS and JavaScript with no RequireJS, jQuery, Knockout or Alpine.js, so it works on Hyvä and Luma based themes.
Who gets profiled
- The profiler is off by default. Nothing is recorded until Enable Profiler is set to Yes.
- Even then, a request is recorded only when the browser has a profiling session started from the admin Profiler Runs page (a signed cookie) or comes from an IP in Allowed IP Addresses. The value * records every visitor, except in production mode, so keep the list to your own addresses.
- A profiled browser gets an uncached page variant, so the toolbar works on every page, while other visitors keep getting cached pages.
- String literals in recorded SQL and non-numeric bind values are masked, and sensitive URL parameters are replaced with
***before a run is stored.
Admin report and cleanup
With Persist Profiler Runs on, each profiled request is saved after the response is sent. The Profiler Runs grid has paging, sorting, a URL search and a minimum severity filter, and each run has a detail page. A run can be downloaded as an XLS file (Excel 2003 XML) or opened as a print-ready HTML report that you save as PDF from the browser. An hourly cron job and the bin/magento panth:perf:cleanup command delete runs older than the retention period (24 hours by default).
Requirements
- Magento Open Source or Adobe Commerce 2.4.4 to 2.4.8.
- PHP 8.1, 8.2, 8.3 or 8.4.
- Panth Core, installed by Composer as a dependency. Magento cron for the automatic cleanup.
Free and open source under the MIT License.
| Module Category | Performance |
|---|---|
| Best For | All Sizes |
Questions before you install?
Send me your composer.json and I will check for conflicts first. Free. Installation is +$45, custom work is quoted first.