Contents

1 Introduction
 1.1 Motivation
 1.2 Method
 1.3 Expected Results
 1.4 Outline of the Thesis
2 Terms
 2.1 Caching
  2.1.1 Invalidation
  2.1.2 Privacy
 2.2 Load
  2.2.1 Using the uptime command
  2.2.2 Using the top command
  2.2.3 Load Averages
I  Environment
3 Application
 3.1 Bandnews.org
  3.1.1 Technology
  3.1.2 Page Structure
  3.1.3 myBandnews
  3.1.4 BandnewsCMS
4 Tools
 4.1 Apache
  4.1.1 History
  4.1.2 Features
  4.1.3 Alternatives
 4.2 PHP
  4.2.1 History
  4.2.2 Language Basics and Structure
  4.2.3 Integration with the web server
  4.2.4 Additional Libraries
  4.2.5 Alternatives
 4.3 MySQL
  4.3.1 PEAR::DB
  4.3.2 Query Cache
  4.3.3 Alternatives
 4.4 Smarty
  4.4.1 Template Basics
  4.4.2 Alternatives
 4.5 Squid
  4.5.1 Use cases
  4.5.2 HTTP Acceleration
  4.5.3 Alternatives
 4.6 Advanced PHP Cache
  4.6.1 Concept
  4.6.2 Alternatives
 4.7 Advanced PHP Debugger
  4.7.1 Debugging
  4.7.2 Profiling
  4.7.3 Alternatives
 4.8 ApacheBench ab
  4.8.1 Alternatives
II  Tuning the Application
5 Evaluation
 5.1 Goal definition
 5.2 Processing a Request
 5.3 Possible Hooking Points
  5.3.1 Client Request
  5.3.2 PHP Module
  5.3.3 Database
  5.3.4 Application
 5.4 Bandnews.org
  5.4.1 Skeleton page
  5.4.2 Index page index.php
  5.4.3 Search page search.php
  5.4.4 Links page links.php
 5.5 Testing
  5.5.1 Preparations
  5.5.2 Testing environment
6 Squid
 6.1 Considerations
  6.1.1 Caching of whole pages
  6.1.2 Programmer’s view
  6.1.3 Expected Results
 6.2 Preparation
  6.2.1 Configuring Apache
  6.2.2 Configuring Squid
 6.3 Results
  6.3.1 skeleton-t.php
  6.3.2 pres-skel-t.php
  6.3.3 index.php
 6.4 Conclusions for Squid
7 APC
 7.1 Considerations
  7.1.1 Compiler Cache
  7.1.2 Code Optimization
  7.1.3 Outputting Data
  7.1.4 Programmer’s View
 7.2 Preparation
  7.2.1 Output Buffering
 7.3 Results
  7.3.1 Results for output testing
 7.4 Conclusions for APC
8 MySQL
 8.1 Considerations
  8.1.1 MySQL Query Cache
  8.1.2 Persistent Connections
  8.1.3 Query Tuning
 8.2 Preparation
 8.3 Results
  8.3.1 Query Cache
  8.3.2 Persistent Connection
 8.4 Conclusions for MySQL
9 Smarty Caching
 9.1 Considerations
  9.1.1 Caching Page Parts
  9.1.2 Database Usage
 9.2 Preparation
 9.3 Results
 9.4 Conclusions for Smarty Caching
10 Conclusions
 10.1 Further Work
A File Sources
 A.1 Benchmark Script
 A.2 Patch Files
References