■ INTRODUCTION
xvi
Chapter 3 – PHP Code Optimization
We begin to jump into the PHP code within this chapter. You will learn about PHP best coding practices
when it comes to performance. You will learn about constructing a faster-running for loop, how to
include files using the optimal PHP function, and, most importantly, how to use and install VLD, strace,
and Xdebug. Once VLD and strace are installed, you will analyze Opcode, as well as the Apache C-level
processes that your PHP script requires to run. Using Xdebug on the other, we will identify bottlenecks
within the PHP code itself.
Chapter 4 – Opcode Caching
Knowing the PHP life cycle is important to optimizing, so you will learn about the life cycle within this
chapter. You will learn the steps PHP takes during a user request and identify areas where we can
optimize using Opcode cachers. You will learn how to install and configure Opcode cachers such as APC,
XCache, and eAccelerator, all the while benchmarking our before and after scripts to see the gains from
caching our Opcode.
Chapter 5 – Variable Caching
Building on the information about aching covered in Chapter 4, you will be introduced to variable
caching tools, such as Memcached, as well as using APC to store information. You will learn to install,
configure, and implement a simple example to get you familiar with the software, as well as a real-world
example using a database result set.
Chapter 6 - Choosing the Right Web Server.
Until recently there was only one game in town, anybody considering a large-scale deployment would
use the defacto standard, Apache. Recently however some new and exciting alternatives have come to
the fore. In this chapter we will look at Apache in detail, and stack it up against newcomers Lighttpd and
Nginx.
Chapter 7 - Apache Web Server Optimization
Out of the box Apache is a very capable web server package, but with a little tuning and some tricks of
the trade we can increase its performance and durability and really make it sing. In this chapter we will
also look at some of the secrets of scaling out to support higher traffic and user loads.
Chapter 8 - Database Optimization.
In most web applications, the database server plays a major role. In this chapter we will look at
optimizing the mysql database server, providing methods and tools that will allow you to keep your
system in tip top shape.