Latest ESXX Release


Monday, August 4, 2008

Dog Food

Time to eat my own dog food.

I have finally converted esxx.org to use ESXX to generate the content, and it turned out more or less the way I expected it to. And not a single URL changed! Unless you knew, you couldn't tell that the pages are dynamically generated using JavaScript and XSLT.

Except for the tiny configuration file and the XSLT stylesheet used, there are a few lines of code that loads and parses the actual page, calculates some HTTP headers required for caching and, for completeness, also handles the "If-Modified-Since" request header.

On my less-than-$1000 server and measured over a gigabit ethernet wire, it's humming along at a little more than 350 requests per second. While far from spectacular, it's definitely reasonable and more than enough for my needs. The major operations involved are:
  1. Perform a directory listing to get file meta-data
  2. Load the file from disk and parse it, including some external entity references, using a DOM XML parser
  3. Run the document through an XSLT 2.0 stylesheet processor and serialize the result
Here is a summary of the benchmark:
[martin@elsa public_html]$ ab -n 1000 -c 30 http://esxx.org/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking esxx.org (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software: Apache/2.0.52
Server Hostname: esxx.org
Server Port: 80

Document Path: /
Document Length: 23127 bytes

Concurrency Level: 30
Time taken for tests: 2.695609 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 23394000 bytes
HTML transferred: 23127000 bytes
Requests per second: 370.97 [#/sec] (mean)
Time per request: 80.868 [ms] (mean)
Time per request: 2.696 [ms] (mean, across all concurrent requests)
Transfer rate: 8474.89 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.2 0 1
Processing: 12 79 35.7 73 305
Waiting: 11 75 35.1 69 296
Total: 13 79 35.6 73 305

Percentage of the requests served within a certain time (ms)
50% 73
66% 85
75% 94
80% 103
90% 126
95% 147
98% 175
99% 193
100% 305 (longest request)
[martin@elsa public_html]$
But why stop there? I also activated Apache's mod_disk_cache in front of it and that raised the page rate to about 2500 requests/second and lowered the maximum latency to 19 ms. It's always reassuring to know you're Slashdot-ready ...

Edit: Seems like I got bitten by an Apache bug. In 2008. That's rather sad ... Cache disabled.

No comments: