Will switching to a new PHP version improve your Magento online store’s speed? In this blog post, we share the results of testing Magento Open Source performance with different versions of PHP, from 8.1 to 8.2.
Site speed is a crucial factor for both user experience (UX) and search engine optimization (SEO). The faster your website, the better. Merchants using the latest versions of Magento Open Source and Adobe Commerce (2.4.6 and 2.4.7) can choose which PHP version to use for their website.
We decided to test, how PHP version affect Magento Open Source website performance.
Magento 2.4.6
Magento version 2.4.6 supports PHP 8.1 and 8.2. Let’s examine how changing PHP versions impacts website speed.
The chart below shows the speed of a homepage with caching disabled. PHP 8.2 provides a 2.5-3x performance boost over PHP 8.1—a significant improvement.
But what if we enable caching?
With caching enabled the boost is less significant (2-2.5x), but still very solid.
The boost stands true for other pages.
Performance without Caching
Performance with caching enabled
With caching enabled, the improvement is less pronounced (2-2.5x) but still notable. This boost applies to other pages as well.
Magento 2.4.7
This version supports PHP 8.2 and PHP 8.3. Let’s see how these PHP versions affect page load speed.
Performance without Caching
Here we see that switching to a newer PHP version doesn’t provide such substantial boost, in some cases it works even slower with PHP 8.3 than PHP 8.2
Performance with caching enabled
Again rather mixed bag result, with no clear performance gain from switching to PHP 8.3.
Switching to PHP 8.2 is highly recommended for Magento 2.4.6 and 2.4.7 users, as it offers significant performance gains. Upgrading to PHP 8.3 is less clear-cut, especially from a performance perspective.
Which Magento is faster – 2.4.6 or 2.4.7?
Now, let’s compare Magento versions on the same PHP engine (8.2). Surprisingly, the older Magento 2.4.6 with PHP 8.2 is actually faster!
Full Test Results
Here are the summarized test results:
Magento Version | PHP Version | Caching Status | Page Type | Avg | Min | Med | Max | P90 | P95 |
2.4.6-p6 | 8.1.29 | enabled | Home | 184.42 | 114.97 | 119.85 | 798.04 | 462.87 | 587.01 |
2.4.6-p6 | 8.1.29 | enabled | Category | 190.4 | 115.58 | 122.63 | 705.72 | 475.43 | 599.82 |
2.4.6-p6 | 8.1.29 | enabled | Product | 188.93 | 113.16 | 123.06 | 707.49 | 473.89 | 598.95 |
2.4.6-p6 | 8.1.29 | disabled | Home | 930.49 | 817.33 | 846.65 | 2160 | 918.1 | 1670 |
2.4.6-p6 | 8.1.29 | disabled | Category | 1610 | 1400 | 1450 | 3090 | 1870 | 2930 |
2.4.6-p6 | 8.1.29 | disabled | Product | 1080 | 957.64 | 989.77 | 2520 | 1060 | 1960 |
2.4.6-p6 | 8.2.21 | enabled | Home | 93.5 | 57.6 | 59.25 | 401.5 | 232.84 | 308.19 |
2.4.6-p6 | 8.2.21 | enabled | Category | 96.55 | 60.53 | 65.61 | 400.37 | 236.6 | 296.04 |
2.4.6-p6 | 8.2.21 | enabled | Product | 95.41 | 56.16 | 64.01 | 385.66 | 230.3 | 293.3 |
2.4.6-p6 | 8.2.21 | disabled | Home | 372.77 | 303.91 | 325.74 | 1000 | 380.65 | 678.65 |
2.4.6-p6 | 8.2.21 | disabled | Category | 604.17 | 501.67 | 551.36 | 1460 | 616.56 | 1080 |
2.4.6-p6 | 8.2.21 | disabled | Product | 434.3 | 359.02 | 385.11 | 1100 | 640.48 | 754.49 |
2.4.7-p1 | 8.2.21 | enabled | Home | 105.98 | 64.63 | 72.12 | 431.73 | 253.39 | 331.58 |
2.4.7-p1 | 8.2.21 | enabled | Category | 107.52 | 65.35 | 74.28 | 375.04 | 236.23 | 320.2 |
2.4.7-p1 | 8.2.21 | enabled | Product | 108.54 | 66.33 | 70.14 | 451.3 | 271.55 | 337.47 |
2.4.7-p1 | 8.2.21 | disabled | Home | 409.34 | 334.2 | 358.04 | 1080 | 419.64 | 725.88 |
2.4.7-p1 | 8.2.21 | disabled | Category | 672.85 | 559.2 | 593.15 | 1770 | 702.28 | 1200 |
2.4.7-p1 | 8.2.21 | disabled | Product | 472.66 | 381.27 | 424.81 | 1210 | 502.37 | 831.32 |
2.4.7-p1 | 8.3.9 | enabled | Home | 105.91 | 64.69 | 69.04 | 445.12 | 253.97 | 326.7 |
2.4.7-p1 | 8.3.9 | enabled | Category | 109.9 | 66.31 | 74.56 | 346.18 | 199.58 | 269.1 |
2.4.7-p1 | 8.3.9 | enabled | Product | 102.72 | 63.77 | 66.76 | 433.32 | 249.63 | 320.6 |
2.4.7-p1 | 8.3.9 | disabled | Home | 417.28 | 337.39 | 370.21 | 1080 | 437.87 | 723.56 |
2.4.7-p1 | 8.3.9 | disabled | Category | 657.31 | 549.56 | 589.48 | 1760 | 678.12 | 1180 |
2.4.7-p1 | 8.3.9 | disabled | Product | 417.69 | 338.66 | 370.87 | 816.23 | 635.75 | 720.21 |
Short notes about testing methodology
We used AWS t4g.2xlarge instances to host Magento with all required services on a single machine. The websites ran the default stock Magento (Luma front-end theme) with sample data. File-based caching was used.
For testing, we utilized the open-source K6 tool hosted in the same network to minimize latency. The test involved 20 virtual users and 100 iterations.
The numbers in the result columns are in milliseconds and represent HTTP request duration.