APC

APC - Alternativer PHP Cache

Installation

pecl install apc

Konfiguration

/etc/php5/conf.d/apc.ini

Gegebenenfalls Speicherlimit anpassen. ⇒ apc.shm_size = 64M

Administration

/usr/share/php/apc.php

In ein web Verzeichnis kopieren oder symlink erstellen.

Tests

siege -b -c 1 -r 500 http://foo.bar/ >/dev/null

Ohne APC

Transactions:                    500 hits
Availability:                 100.00 %
Elapsed time:                  58.95 secs
Data transferred:               1.18 MB
Response time:                  0.12 secs
Transaction rate:               8.48 trans/sec
Throughput:                     0.02 MB/sec
Concurrency:                    1.00
Successful transactions:         500
Failed transactions:               0
Longest transaction:            0.16
Shortest transaction:           0.11

Mit APC

Transactions:                    500 hits
Availability:                 100.00 %
Elapsed time:                  25.44 secs
Data transferred:               1.18 MB
Response time:                  0.05 secs
Transaction rate:              19.65 trans/sec
Throughput:                     0.05 MB/sec
Concurrency:                    1.00
Successful transactions:         500
Failed transactions:               0
Longest transaction:            0.12
Shortest transaction:           0.04

Ergebnis

APC beschleunigt PHP im Test um ~56%.