FrankenPHP, RoadRunner and Swoole all use workers to handle incoming requests much more quickly. Now, let's look at how many requests each web server can process per second.
Testing environment: 13th Gen Intel® Core™ i7-1355U × 12, 16 GB
Testing tool: wrk
Prepare the FrankenPHP testing application.
- Clone the yiisoft/app repository.
- Add the yiisoft/yii-runner-frankenphp package to the
composer.json:
{
// ...
"require": {
// ...
"yiisoft/yii-runner-frankenphp": "^1.0"
},
}
- In your application root create worker.php.
- Replace the contents of the
docker/dev/Caddyfilewith the following:
{
skip_install_trust
frankenphp {
}
}
{$SERVER_NAME::80} {
encode zstd br gzip
php_server {
root /app/public
worker {
num 12 # number of workers
max_threads 12 # number of threads
match *
file /app/worker.php
}
}
}
- Replace the contents of the
docker/dev/.envwith the following:
APP_ENV=prod
APP_DEBUG=false
SERVER_NAME=:80
- Set
DEV_PORTin thedocker/.env:
DEV_PORT=8080
- Run
make composer update. - Run
make up.
Run benchmark testing:
./wrk -t12 -c1000 -d30s http://localhost:8080
Prepare the RoadRunner testing application.
- Clone the klsoft-web/yii3-road-runner-app repository.
- Add
num_workers: 12to the pool section of the.rr.yamlfile. - Run
docker compose up -d.
Run benchmark testing:
./wrk -t12 -c1000 -d30s http://localhost:8080
Prepare the Swoole testing application.
- Clone the klsoft-web/yii3-swoole-app repository.
- Add to the
config/common/params.php:
return [
// ...
'klsoft/yii3-swoole' => [
'swooleServerSettings' => [
'reactor_num' => 12, // number of threads
'worker_num' => 12 // number of workers
]
],
];
- Run
docker compose up -d.
Run benchmark testing:
./wrk -t12 -c1000 -d30s http://localhost:9501
Results

Top comments (0)