MySQL native driver for PHP: Query cache plugin benchmark impressions
mysqlnd_qc:  Benchmark impressions Ulf Wendel, Andrey Hristov MySQL Connectors Team Sun Microsystems
Table of Contents Setup and Warning Hardware
Software Oxid eShop Single machine
Two machines Artificial tests qc_load.php, mysqlnd_qc_perf.phpt
Conclusions
Performance art Performance by number of columns and result set size
Hardware / Software Box A: Intel Core 2 Duo E6750 @ 2.66 GHz RAID-0, 4 GM RAM
Apache 2.2.6 (MPM = prefork = default)
PHP 5.3.3-dev
MySQL 5.1.39-debug Source
APC 3.1.3p1
Memcache 1.4.3
libmemcached 0.37
Hardware / Software Box B: Athlon 64 X2 Dual Core 5000+ MySQL 5.1.25-rc Source 1 GBit network
Runs ouf of RAM
Single machine setup Box A running PHP, Apache, MySQL, Memcache Two machines setup Box A running PHP, Apache, Memcache
Box B running MySQL
Oxid eShop 4.2.0 Price winning PHP web shop Community Edition 4.2.0 Generates high CPU and DB load Object-oriented design, many layers
ADOdb Lite, ext/mysql
Smarty
Demo shop frontpage: ~150 database queries
Real-life shop frontpages: >>1k database queries
No practical value? ab -n <x> -c <y> <url>/oxid/index.php Front page only
No browsing
No ordering
Assumption: all queries can be cached Theoretical not practical results Run your own tests!
We show theoretical maximum, only!
bench/qc_load.php Run <n> queries for <m> seconds fetch <o> rows per query No practical meaning Storage handler stress testing, only!
tests/mysqlnd_qc_perf.php Run <n> times SELECT to fetch one row <m> columns
<o> bytes total per row No practical meaning Storage handler stress testing, only!
Table of Contents Setup and Warning Hardware
Software Oxid eShop Single machine
Two machines Artificial tests qc_load.php, mysqlnd_qc_perf.phpt
Conclusions
Oxid, 1 box: PHP/Apache/MySQL CPU bound from 2 clients on, MySQL Server QC wins
Oxid, 1 box: 1 vs. 10 clients absolut Higher impact once CPU bound, MySQL Server QC wins
Oxid, 1 box: 1 vs. 10 clients relative Relative: 200% – 400%, MySQL Server QC wins
MySQLnd QC  Plugin vs. Server QC MySQLnd QC Plugin is insecure Can serve stale data
No knowledge of transactions
No knowledge of temporary tables
No knowledge of user variables
No knowledge of MERGE and stuff
No authentification
No protection of cache entries Server QC can cache more For benchmarks set: cache_no_table = 1

Mysqlnd query cache plugin benchmark report