This book is a work in progress new chapters will be added as they are written.We welcome feedback if you spot any errors or would like to suggest improvements,please email .
Overture: Who Should Read This Book (and Why)
If you want to help make the Web faster and smarter, read this book.
If youre involved in designing, creating, developing, or running a Web site, this book for you. This book is entirely focused on helping you improve your users experience by making it faster.
This is a book about Web performance about understanding how the Web works under the covers from a performance point of view, and why some sites on the Web are faster than others.
How to make the slower ones faster, and the fast ones faster still, is the most important goal.
The original title of this book was End-to-End Web Performance and while the title and content have evolved over time, were going to cover the entire HTTP request/response cycle, examining it in detail to find out what really happens when you load a Web page, tweet your latest achievement or play an online game (and why it takes so long). Along the way Ill introduce a simple model for reasoning about end-to-end response times, and talk about how to use it to think about performance in a new way.
Using our simple model, well see how to identify performance problems easily, prioritize them, analyze them, and then optimize them. Perhaps most importantly, I want to help you to prevent performance problems before they occur, and that will be one of the big themes of this book.
Web Performance is a complex topic, and theres a lot to learn. I want to help readers understand the big picture on performance, and how it relates to systems thinking another theme of the book.
Well be looking at a lot of data on how long it takes Web sites to load in the course of this book, and Ill focus on learning how to gather and examine performance data in every chapter (after this one). Testing things for yourself, and gaining a hands-on, intuitive feel for the numbers, is the best way to become an amazing performance expert. I also want to inject a sense for how things work in the so-called real world, using real data from real users, rather than idealized performance numbers that are never experienced by ordinary users.
Why You Should Read This Book
This book is written specifically for people working on Web experiences. Since performance is a design-time activity I want especially to reach the people who are involved in the design and development process. But a good Web experience on a desktop, a mobile device or some other Web client involves a lot more than just good design. Once the design is ready, then its the developers turn, and then after your Web experience goes live, its the operational aspects of the system that drive the quality of the user experience, and I want to write my book so that its useful to everyone involved. If you are into building coolstuff on the Web, and want to make it faster, please read this book.
Heres a partial list of roles performed by people involved inperformance work that Id like to reach with my book.
- Web Designers who want to create faster Web experiences withperformance baked in up front, that is, part of the initial design.
- Developers who want to build faster services andapplications, avoid common problems and write software that really helps users
- Systems engineers and operations staff - who face the difficult task ofmaking sure the Web is fast, all the time, and quickly resolving problems when they come up.
- Performance Engineers and Analysts who are involved inidentifying ways to make the Web faster and resolve performance issues on behalf of the end user.
- Project and People Managers who need to understand Web Performance as partof their area of responsibility and make wise decisions about performance as part of their overall strategy.
What Well Cover
This book is intended to get you started thinking about Web performance, and provide you with the knowledge and skills required to tackle performance problems and optimize your Web experiences. So Ill start from the beginning, and try to give you a real overview of the performance domain. Ive tried to organize the book to provide a good mixture of both theory and practice, only introducing enough math to support our analysis and trying to focus on whats really happening.
One of the big challenges in writing this book has been to decide what to leave out, rather than what to include, and theres any number of topics that might have been included, but were not, in the name of staying focused. I havent covered, for example, every possible edge case, and as a friend said to me in the course of writing this book, Theres an exception to everything on the Web. Its true, but here well try to cover the most likely scenarios, under the sorts of circumstance that ordinary users face in their lives.
Another challenge is introducing a lot of technical words and ideas, some of which may be unfamiliar to readers, in a few short pages. Ive made a point of making sure that everything is explained as we go along, and not to make any assumptions. My goal is to make sure that you are as interested and excited about performance as I am, and that Im communicating what are often complex ideas so that everyone has a shared understanding.
Test it yourself is another big theme and as we go through the book Ive added several hands-on sections and suggested tests for you to try for yourself. Ive found that people grasp and retain information far more easily if they are able to actually perform the work themselves. Theres an element of personal knowledge involved in Web performance work, and engaging with real numbers and data is the best way to get a feel for performance problem solving. I hope you enjoy these exercises as much as I enjoyed putting them together.
I want to start off by explaining what Web performance is, in Chapter 1, and explain how performance fits into the bigger picture of the entire system, the systemic qualities, and the trade-offs involved from a high-level. Then well zoom in on performance and look at some of the factors involved in the End-to-End response time (E2E).
One important topic well cover in Chapter 1 is How fast is fast enough? This will introduce another important idea - that users are the most important component on the Web, and fast enough depends on them, not on clients, networks, or servers.
In chapters 2-7 well be talking specifically about the response time of the HTTP request/response cycle, and covering it in detail will lead us to the Multiple Parallel Persistent Connections (MPPC) model, which gives us a framework for understanding what happens under the covers when we surf the Web, starting with an overview in Chapter 2.
Ill go over each of the MPPC time segments (more on this later) in chapters 3-6, and describing whats actually happening in the client, network, and server(s), as well as how to identify problems and optimize the different contributions to the E2E. Along the way well find opportunities to test and measure various aspects of Web response time in the hands-on exercises, intended to give you a concrete sense of whats happening. Chapter 7 will tie it all together, bringing all the different aspects of our model into focus.