Hi all,

I have converted my text-only guide to web application performance using
mod_perl and DBI into HTML.  The guide now lives alongside my DBI
examples page at http://www.saturn5.com/~jwb/dbi-performance.html .

I have also conducted a silly benchmark to see how all of these
optimization affect performance.  Please remember that it is dangerous
to extrapolate the results of a benchmark, especially one as
rudimentary as this.  With that said please consider the following
data.

Environment:
DB Server: Oracle 8.0.6, Sun Ultra2, 2 CPUs, 2GB RAM, Sun A1000 disks
App Server: Linux, PII 350, 128MB RAM, Apache 1.3.6, mod_perl 1.19
Benchmark Client: ApacheBench on same machine as application server

Each benchmark consisted of a single request selecting one row from the
database with a randomly selected primary key.  The benchmark was run
through 1000 requests with 10 simultaneous clients.  The results were
recorded using each level of optimization from my tutorial.

Zero optimization: 41.67 requests/second
Stage 1 (persistent connections): 140.17 requests/second
Stage 2 (bound parameters): 139.20 requests/second
Stage 3 (persistent statement handles): 251.13 requests/second

It is interesting that the Stage 2 optimization didn't gain anything
over Stage 1.  I think this is because of the relative simplicity of my
query, the small size of the test database (1000 rows), and the lack of
other clients connecting to the database at the same time.  In a real
application, the cache thrashing that is caused by dynamic SQL
statements would probably be detrimental to performance.  In any case
Stage 2 paves the way for Stage 3, which certainly does increase the
request rate!

So, check it out at http://www.saturn5.com/~jwb/dbi-performance.html

Cheers,
Jeffrey
-- 
Jeffrey W. Baker * [EMAIL PROTECTED]
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807

Reply via email to