Guide to Optimizing PHP for High Traffic Sites

Note: This article serves as an overview and index, connecting you to previous detailed PHP optimization articles. For comprehensive insights on each topic, please follow the provided links to previous articles under the subheadings below. It made more sense to connect these articles here for your convenience, rather than trying to merge 12 articles covering […]

PHP 8.3 is Out! – 60% Still Using End-of-Life PHP 7

Yesterday, on November 23, 2024, the PHP community welcomed the release of PHP 8.3, marking another milestone in the evolution of this widely used scripting language. With PHP powering 76.7% of all websites with known server-side programming languages, upgrading PHP is critical in ensuring the security, efficiency, and overall user experience of a significant portion […]

PHP 8 Compatibility Check and Performance Tips

PHP 7 was first released back on 03 Dec 2015. It’s been around a while! The PHP team encouraged upgrading to PHP 7, hailing its improvements such as being twice as fast, consistent 64-bit support, removing old and unsupported SAPIs and extensions, and improved fatal error resistance, to name a few. A few years ago, […]

PHP memory_limit – understanding and increasing

PHP’s memory_limit is per-script, just as a highway’s speed limit is per-vehicle. For example, although PHP’s memory limit may be set to 1GB, that does not mean that scripts will pile up to use that 1 GB. Let’s take a closer look at understanding PHP’s memory_limit setting.   PHP memory_limit is a per-script setting PHP.net’s […]

Memcache PHP Extensions for Memcached Caching Daemon

Memcached (Memcache Daemon) is a caching daemon designed especially for dynamic web applications to decrease database load by storing objects in memory. It is commonly used to speed up dynamic database-driven websites by caching data and objects in server memory to reduce the number of times the data source must be read. Memcached is free […]

PHP-FPM tuning: Using ‘pm static’ for max performance

Let’s take a very quick look at how best to set up PHP-FPM for high throughput, low latency, and more stable CPU and memory use. By default, most setups have PHP-FPM’s PM (process manager) string set to dynamic and there’s also the common advice to use ondemand if you suffer from available memory issues. However, let’s […]

Monitoring PHP Performance and Diagnosing Bottlenecks

As one of the most widely used scripting languages for web development, PHP is known for its flexibility and ease of use. However, with complex applications and increasing traffic, PHP performance can sometimes take a hit. Monitoring PHP performance and diagnosing bottlenecks is essential to ensure that your web applications are running smoothly and efficiently. In […]

PHP performance: oPcache Control Panels

OPcache is a PHP extension that improves PHP performance by storing precompiled script bytecode in shared memory, thereby removing the need for PHP to load and parse scripts on each request. The extension is built-in for PHP 5.5+. If you want to improve PHP performance, the first step should be to use PHP 8+, which […]

PHP Benchmarks: OPcache vs OPcache w/ Performance Tweaks

A few weeks ago, I wrote a short article highlighting GUI solutions for monitoring and controlling PHP OPcache. We all know that enabling PHP OPcache provides massive performance gains (see benchmark graph at the end of the article). In addition, since PHP 5.5, OPcache is now enabled by default. With these facts in mind, is […]

Set PHP realpath_cache_size ‘correctly’

In 2012, I started enabling PHP realpath_cache_size and realpath_cache_ttl for performance benefits. At the time, I followed the settings I found here (has since been deleted). It bugged me that I was blindly setting the cache size without knowing how much storage was actually being used. In this post, I will demonstrate how to view the […]

Top ↑