Приглашаем посетить
Паустовский (paustovskiy-lit.ru)

Chapter 17.  Application Benchmarks: Testing an Entire Application

Previous
Table of Contents
Next

17. Application Benchmarks: Testing an Entire Application

PROFILING IS AN EXHAUSTIVE PROCESS. A PROFILER needs to be set up, multiple profile runs need to be performed, and tedious analysis often needs to be performed. For a large or complex script, a profiling/tuning cycle can easily take days to complete thoroughly. This is fine.

Profiling is like a detective game, and taking the time to probe the guts of a page and all its requisite libraries can be an interesting puzzle. But if you have 1,000 different PHP pages, where do you start? How do you diagnose the health of your application?

On the flip side, you have load testing. The project you have invested the past six months to developing is nearing completion. Your boss tells you that it needs to be able to support 1,000 users simultaneously. How do you ensure that your capacity targets can be achieved? How do you identify bottlenecks before your application goes live?

For too many developers and project architects, the answers to all these questions involve guesswork and luck. Occasionally these methods can produce resultsenough so that many companies have a guru whose understanding of their application gives his instinctual guesses a success rate 10 or 100 times that of the other developers, putting it at about 10%.

I know. I've been that developer. I understood the application. I was a smart fellow. Given a day of thought and random guessing, I could solve problems that baffled many of the other developers. It gained me the respect of my peersor at least an admiration of the almost mystical ability to guess at problems' origins.

The point of this story is not to convince you that I'm a smart guy; it's actually the opposite. My methods were sloppy and undirected. Even though I was smart, the sound application of some benchmarking techniques would have turned up the root cause of the performance issues much faster than my clever guessingand with a significantly better success rate.

Application benchmarking is macro-scale testing of an application. Application benchmarking allows you to do several things:

  • Make capacity plans for services

  • Identify pages that need profiling and tuning

  • Understand the health of an application

Application benchmarking will not identify particular blocks of code that need tuning. After you have generated a list of pages that need deeper investigation, you can use techniques discussed in Chapter 19, "Profiling," to actually identify the causes of slowness.


Previous
Table of Contents
Next