Talk:Daemon redesign
From StatusNet
[edit] Forking overhead
Quick tests on my Linux server; loading up common.php & a whole bunch of classes from lib/ to maximize the pain. Work payload is a loop that runs in 1-2ms.
Ubuntu 8.04, PHP 5.2.6, APC installed and cli testing mode enabled. Overhead measured as runtime difference against baseline, divided by count of items run to get a per-item launch overhead.
- Baseline: running 1000x within one process after loading all classes
- Initialize, then pcntl_fork() 1000x: 28ms/item
- pcntl_fork() 1000x with initialization in child (APC on): 37ms/item
- http->mod_php+APC (over localhost): 111ms/item
- pcntl_fork() 1000x with initialization in child (APC off): 137ms/item
- Shell out individually 1000x: 150ms/item overhead (APC off; cache doesn't survive to next process)