Skip to main content
main-content

Über dieses Buch

Pro PHP Application Performance will help you understand all the technologies and components which play a role in how well your applications run. When seconds can mean the difference between retaining a user and losing a user, it's important for all of us to have optimization as part of our project roadmap. But what components within your application should you analyze? How should you optimize? And how can you measure how well your application is performing? These are some of the questions that are answered in this book.

Along the way you will also learn the "why" of optimizing. You’ll discover why you should optimize a specific component, why selecting one function over another is beneficial, and how to find and use the optimization tools available to the open source community. You’ll also learn how to deploy caching software as well as web server software. Pro PHP Application Performance will also teach you more advanced techniques, such as:

• Using Xdebug to profile functions that are not running as efficiently as possible.

• Comparing opcode executed by different PHP functions to narrow the search for functions that run efficiently.

• Using strace to analyze Apache while your application is served to the user.

Once you complete this book you will have a complete sense of where to start optimizing and, most importantly, have the tools which allow you to continue optimizing in other PHP applications going forward.

Inhaltsverzeichnis

Frontmatter

Chapter 1 Benchmarking Techniques

Abstarct
The phone rings and a voice on the other end yells, “Hey! Why can’t this application support 200 concurrent users?” You take a deep breath, and in your most senior PHP tone you mutter, “Odd, I’ll take a look at what’s happening and provide a solution.” Flash back to a few weeks prior to this conversation. You were tasked to build a database-driven PHP application, and by all accounts the requirements outlined a simple PHP application. As a seasoned PHP developer, you began to write code, creating the basic architectural layers, the PHP back end, the CSS, the JavaScript, and because you’re well-versed in Photoshop, you also created the graphical layout, and released the application to production.
Armando Padilla, Tim Hawkins

Chapter 2 Improving Client Download and Rendering Performance

Abstarct
In the previous chapter, you learned how to measure response time and determine how a web page would respond during different traffic loads, using the tools Apache Benchmark (ab) and Siege. With these results, you could determine if your web server could serve sufficient amount of pages while under duress and determine how fast (or slow) the response would be. If only life were this easy and everyone used a terminal to view a web page, we could retain these results and skip this chapter. Unfortunately, reality is much more complicated than that, and it comes in the form of a web browser. You will now focus on the initial component, and a key component to any online PHP application, the front-end side of your application. In this chapter, we will focus on the performance of your application from the user’s browser.
Armando Padilla, Tim Hawkins

Chapter 3 PHP Code Optimization

Abstarct
Opcode caching, data caching using Memcached, and optimizing your database are all great optimization tricks you will learn once you’re done with this book. But before reaching those chapters, we need to learn how to apply the best coding practices. Knowing when to use a specific PHP function over another and making small incremental changes in your code can change the performance of your PHP code.
Armando Padilla, Tim Hawkins

Chapter 4 Opcode Caching

Abstarct
Removing any unnecessary process when a request is made to a PHP script is now our goal when speeding up our PHP scripts. By removing a process that does not have to routinely execute during the PHP life cycle, we optimize our application to respond faster to any of our users’ requests.
Armando Padilla, Tim Hawkins

Chapter 5 Variable Caching

Abstarct
Modern, rich web applications all contain some type of method that allows users to interact with the application. The most popular method these days is updating a status within your favorite social network web application. In almost all cases, these user interactions are saved within an external non-volatile storage solution, and in almost all cases, the saved content is redisplayed to users within a listing page.
Armando Padilla, Tim Hawkins

Chapter 6 Choosing the Right Web Server

Abstarct
Since it is the responsibility of the web server software to look for any incoming requests, delegate what the request is trying to accomplish to the PHP engine, and finally send a response, a portion of the measured speed of our PHP application is tightly coupled with the performance of your web server software. Therefore, we need to prevent the web server from slowing down our application by eliminating unnecessary processing.
Armando Padilla, Tim Hawkins

Chapter 7 Web Server and Delivery Optimization

Abstarct
One of the most important components of your application is the web server it is hosted on. No matter how much you optimize your application, if your web server is not optimized too, you are not going to get the full performance that you may be looking for.
Armando Padilla, Tim Hawkins

Chapter 8 Database Optimization

Abstarct
There have probably been tens of thousands of pages written on the subject of database optimization, a good portion of them relating to MySQL. In one chapter of this book, we will never be able to cover the entire breadth of this subject.
Armando Padilla, Tim Hawkins

Backmatter

Weitere Informationen

Premium Partner

    Bildnachweise