
Profile PHP performance with XHProf by installing the fork and generating call graphs. Optimize slow pages by replacing per-product queries with a single join and preparing for caching.
Rattus, a drop-in replacement for memcached, provides an in-memory cache between the web server and database using a cache-aside pattern to speed pages, with disk persistence and master-slave replication.
Tune nginx for performance by setting worker processes and worker connections, enabling sendfile and tcp optimizations, and adjusting keepalive and gzip settings.
Configure PHP-FPM for high performance by adjusting dynamic process management. Set max children based on memory, start and spare servers, and tune memory limits to optimize scalability.
optimize MySQL performance by using InnoDB, compare with MyISAM, and tune key settings: max_connections, innodb_buffer_pool_size, innodb_io_capacity, query_cache_limit, and query_cache_size, then restart and verify with show variables.
Enable the MySQL slow query log and set a one-second threshold. Log queries to a table for easy diagnosis and faster fixes.
Learn to accelerate queries by using explain to identify bottlenecks, add targeted indexes on favorite_products.customer_id and the products table join keys, and use on duplicate key update for efficient upserts.
Denormalize data to boost read performance by storing category names on the products table. Use foreign key constraints and indexing to maintain referential integrity and balance performance.
Learn how to perform load testing with siege on a two-server EC2 setup behind a load balancer, simulate real user traffic, and tune max children while monitoring server performance.
Learn to install trace view and instrument engine x for live performance monitoring, then inspect traces, heat maps, and slow queries to optimize a high-traffic PHP app.
Performance benchmarks can be misleading when they rely on outdated framework versions and non-representative tests; use qualitative methods to assess real-world framework overhead.
Measure framework overhead by profiling micro, mid, and full-featured PHP frameworks, revealing how file loading and function calls shape performance and trade flexibility for bare-metal speed.
Assess frameworks by reviewing the ORM and eager loading to avoid the plus one query problem, and check performance documentation and tooling to optimize queries.
You too can create fast-running PHP apps that support millions of users. This course, will teach you tips and tricks for speeding up your PHP application. You'll start by learning about micro-optimizations at the code-level, moving on to how many child processes you should be running on your webserver and database options. Finally, you will learn about profiling your code and load testing your application, so you can be confident that it will perform well no matter how large your application becomes. By the end of this course, you'll be able to easily create and optimize PHP apps for speed.