11.01.2013 Views

Workshop

Workshop

Workshop

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

other. Wow!<br />

Application efficiency typically doesn’t change unless the design of the application causes certain events<br />

to make the app handle things differently at certain thresholds (more than x indexes? More than x users?),<br />

which can affect efficiency. Unfortunately, there’s no formula on how to deal with this; you’ll have to<br />

rely on instinct and then test your theory.<br />

Server Limitations<br />

Every server can run out of resources. Once you identify which server a slow application is running on,<br />

you’ll want to check the following items:<br />

• CPU utilization<br />

• CPU “waiting for I/O” statistic<br />

• Swapping statistics/RAM available<br />

Sure, every CPU can “run out of gas.” But most of the time, you’ll see less than 100 percent CPU<br />

utilization. Even when a lot of CPU cycles are available, you still can be slow. Why? It all boils down to<br />

this: Hard drives are slow as dirt, physical memory is the speed of light. Hard drives don’t even begin to<br />

approach how fast memory is. Consider these analogies:<br />

• Using cache memory is like reaching up to your cabinet to get a can of beans.<br />

• Using regular memory is like walking to your pantry to get a can of beans.<br />

• Using “swap” (or virtual memory) is like getting in your car and driving to the grocery store for<br />

a can of beans.<br />

Is it that bad? Pretty close. Even when the CPU is not busy, if your program has to be “paged” back in to<br />

physical memory from virtual (hard drive) memory, it takes a long time, and your performance is going<br />

to suffer. How much swapping is acceptable? For an answer to that, see the “Baselining” section later in<br />

this chapter.<br />

Finally, your application may be disk intensive, regardless of whether there’s enough physical memory to<br />

go around. Database programs, no matter how well indexed, will suffer performance problems if they’re<br />

on nonoptimized disks. This typically isn’t a “new” problem—you’ll see this from the first installation of<br />

an application. However, if index or database files grow to a certain point, taking up more disk space<br />

(and thus taking longer to load), performance may start to degrade. You can see whether your<br />

applications are “disk bound” by checking your “waiting for I/O” CPU statistic. If it’s a large percentage<br />

of the total CPU utilization, you probably have problems.<br />

Measure Twice, Cut Once<br />

The only way to know for sure whether you’re running out of anything—bandwidth, server resources,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!