Wednesday, September 5, 2007

Using Your Poor Man's Performance Lab

Yesterday I talked about setting up a performance analysis tier on the cheap. Now let's talk about how you can use it. For this example, let's assume a basic web application. You have three tiers: a web tier serving content, an app tier working on your business logic, and a database.

Step 1: Defining your test
First, define your "performance problem" (or potential performance problem). Are you testing load? Are your load times awful when there's a lot of data? Are your load times horrific even when it's just one user? Are you mostly interested in what will fail first? Based on this, write a simple test (on whiteboard, in code, whatever your preferred method is). It needs to be as simple as possible.

Step 2: Set up your test
You're going to need to be very certain that you're running the same test every time, so set up carefully. Load all the data you want in, then back up your database. Clear your browser caches on the client. Kick extraneous people off your network. Write your load scripts for background loading.


Step 3: Start your tracers
Turn on SQL Profiler and make sure you're logging queries. Turn on WireShark on each tier and start capturing. Launch FireFox and make sure you have the add-ons (FireBug and YSlow) enabled.


Step 4: Fire it up!
This is the part where the more hands helping the better. Start your volume tools (JMeter or MS ACT), if you are doing load tests. By hand, walk through yoru workflow with your reference client. Once you've done this, you can shut everything down.


Step 5: Gather your traces
Stop the SQL Profiler trace. Stop the WireShark traces and save them. Export your FireBug results. Make a single folder in a central spot and save everything from your test run.

Sure, it's not packaged up nicely for you, but you now have a record of exactly what your systems were doing. Analysis time!

No comments:

Post a Comment