Slim
cat composer.json:
{
"require": {
"slim/slim": "2.*"
}
}
cat htdocs/index.php:
<?php
require __DIR__ . '/../vendor/autoload.php';
$app = new \Slim\Slim();
$app->get('/hello/:name', function ($name) {
echo "Hello, $name";
});
$app->run();
htdocs/.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [QSA,L]
$ du -sh slim
584K slim
$ ab -t 15 -c 10 http://bench-slim.dev.bogus.corp/hello/world
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking bench-slim.dev.bogus.corp (be patient)
Finished 21 requests
Server Software: Apache/2.2.22
Server Hostname: bench-slim.dev.bogus.corp
Server Port: 80
Document Path: /hello/world
Document Length: 12 bytes
Concurrency Level: 10
Time taken for tests: 15.080 seconds
Complete requests: 21
Failed requests: 0
Write errors: 0
Total transferred: 5850 bytes
HTML transferred: 360 bytes
Requests per second: 1.39 [#/sec] (mean)
Time per request: 7180.881 [ms] (mean)
Time per request: 718.088 [ms] (mean, across all concurrent requests)
Transfer rate: 0.38 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 3 3.2 0 7
Processing: 5011 5551 1028.9 5039 7982
Waiting: 10 546 1029.2 29 2977
Total: 5011 5554 1030.9 5042 7988
Percentage of the requests served within a certain time (ms)
50% 5036
66% 5049
75% 5049
80% 5982
90% 7107
95% 7985
98% 7988
99% 7988
100% 7988 (longest request)
Silex
cat composer.json:
{
"minimum-stability": "dev"
"require": {
"silex/silex": "1.0.*"
},
}
cat htdocs/index.php:
<?php
require_once __DIR__.'/../vendor/autoload.php';
$app = new Silex\Application();
$app->get('/hello/{name}', function($name) use($app) {
return 'Hello '.$app->escape($name);
});
$app->run();
htdocs/.htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php [QSA,L]
$ du -sh silex
8,1M silex
$ ab -t 15 -c 10 http://bench-silex.dev.bogus.corp/hello/world
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking bench-silex.dev.bogus.corp (be patient)
Finished 1773 requests
Server Software: Apache/2.2.22
Server Hostname: bench-silex.dev.bogus.corp
Server Port: 80
Document Path: /hello/world
Document Length: 11 bytes
Concurrency Level: 10
Time taken for tests: 15.022 seconds
Complete requests: 1773
Failed requests: 0
Write errors: 0
Total transferred: 414463 bytes
HTML transferred: 19525 bytes
Requests per second: 118.02 [#/sec] (mean)
Time per request: 84.729 [ms] (mean)
Time per request: 8.473 [ms] (mean, across all concurrent requests)
Transfer rate: 26.94 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.1 0 1
Processing: 16 84 28.2 83 176
Waiting: 15 72 25.5 71 169
Total: 16 84 28.2 83 176
Percentage of the requests served within a certain time (ms)
50% 83
66% 96
75% 104
80% 109
90% 121
95% 131
98% 141
99% 149
100% 176 (longest request)