KumbiaPHP Framework Benchmark
Sumario
Version 1.0 Spirit pre beta vs (Symfony, Zend, CakePHP)
Comenzamos a publicar una serie de Benchmark que hemos realizado a la version 1.0 Spirit vs (Symfony, Zend y CakePHP), todos son MVC Frameworks en PHP. La intención es mostrar los avances que hemos obtenido con la última versión (Spirit) de kumbiaphp framework.
Seguimos trabajando para mejorar más la velocidad antes de la versión final pos systems. Además de velocidad, se han hecho cambios para que también sea todavía más fácil y rápido su uso, al facilitar el reuso de código en diferentes partes y que se podrán compartir con la comunidad.
La Metodología, cada Framework que se le aplico las pruebas se hace utilizando las mas mínima medidas de configuración y control posible, de manera de hacer efectiva un “Hola Mundo”, el sell a diamond enfoque minimalista mide la capacidad de respuesta de los componentes del Framework. No hay código de aplicación para ejecutar el controlador de las acciones en el outdoor fountains Framework de cada uno haga lo menos posible para llamar a una vista. Esto nos muestra el máximo rendimiento posible, añadiendo código sólo reducirá la respuesta.
Cada Benchmark de los Framework’s usa los siguientes scripts o equivalentes…
* Bootstrap. * Configuración por defecto. * Front-controller ó dispatcher. * Page-controller ó action-controller. * Una acción sin código, otras que invocan una vista. * Vista estática con solo “Hello World!”.
Se utiliza el Apache por referencia “ab” herramienta para la medición de las solicitudes por segundo, en localhost para negar los efectos de latencia de red, con 10 peticiones concurrentes durante 60 segundos, sin APC. El comando es así:
ab -c 10 -t 60 http://localhost/[path]
Servidor
* Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz. * 3GiB Memoria RAM. * 160GiB Disco Duro. * Server version: Apache/2.2.11 . * S.O. Debian Squeeze. * ApacheBench, Version 2.3.
Resultados
Document Path: /phpmark-read-only/baseline/index.html Requests per second: 2124.27 [#/sec] (mean) Document Path: /phpmark-read-only/baseline/index.php Requests per second: 1255.32 [#/sec] (mean) Document Path: /phpmark-read-only/kumbiaphp-1.0/hola_mundo Requests per second: 34.07 [#/sec] (mean) Document Path: /phpmark-read-only/cakephp-1.2.0/benchmark Requests per second: 15.87 [#/sec] (mean) Document Path: /phpmark-read-only/cakephp-1.2.1/benchmark Requests per second: 15.91 [#/sec] (mean) Document Path: /phpmark-read-only/symfony-1.1.6/web/index.php Requests per second: 12.60 [#/sec] (mean) Document Path: /phpmark-read-only/symfony-1.2.1/web/index.php Requests per second: 10.10 [#/sec] (mean) Document Path: /phpmark-read-only/symfony-1.2.2/web/index.php Requests per second: 11.55 [#/sec] (mean) Document Path: /phpmark-read-only/zend-1.6.2/index.php Requests per second: 23.71 [#/sec] (mean) Document Path: /phpmark-read-only/zend-1.7.2/index.php Requests per second: 23.26 [#/sec] (mean) Document Path: /phpmark-read-only/zend-1.7.3/index.php Requests per second: 23.50 [#/sec] (mean)
Gráfica
Detalles Resultados
~~~ Testing baseline-html : http://localhost/phpmark-read-only/baseline/index.html 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/baseline/index.html Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 23.537 seconds Complete requests: 50000 Failed requests: 0 Write errors: 0 Total transferred: 16602988 bytes HTML transferred: 550099 bytes Requests per second: 2124.27 [#/sec] (mean) Time per request: 4.707 [ms] (mean) Time per request: 0.471 [ms] (mean, across all concurrent requests) Transfer rate: 688.85 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 0.9 2 9 Processing: 1 3 0.9 3 118 Waiting: 0 2 0.7 2 22 Total: 1 5 1.1 5 118 Percentage of the requests served within a certain time (ms) 50% 5 66% 5 75% 5 80% 5 90% 5 95% 5 98% 5 99% 6 100% 118 (longest request) ~~~ Testing baseline-php : http://localhost/phpmark-read-only/baseline/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/baseline/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.003 seconds Complete requests: 37663 Failed requests: 0 Write errors: 0 Total transferred: 9755494 bytes HTML transferred: 414326 bytes Requests per second: 1255.32 [#/sec] (mean) Time per request: 7.966 [ms] (mean) Time per request: 0.797 [ms] (mean, across all concurrent requests) Transfer rate: 317.53 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 3 1.9 4 22 Processing: 1 5 3.4 4 109 Waiting: 0 4 3.1 4 109 Total: 1 8 3.7 9 109 Percentage of the requests served within a certain time (ms) 50% 9 66% 9 75% 9 80% 9 90% 9 95% 9 98% 13 99% 21 100% 109 (longest request) ~~~ Testing kumbiaphp 1.0 : http://localhost/phpmark-read-only/kumbiaphp-1.0/hola_mundo 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/kumbiaphp-1.0/hola_mundo Document Length: 10 bytes Concurrency Level: 10 Time taken for tests: 30.027 seconds Complete requests: 1023 Failed requests: 0 Write errors: 0 Total transferred: 469557 bytes HTML transferred: 10230 bytes Requests per second: 34.07 [#/sec] (mean) Time per request: 293.514 [ms] (mean) Time per request: 29.351 [ms] (mean, across all concurrent requests) Transfer rate: 15.27 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 10.1 0 133 Processing: 56 291 82.4 282 689 Waiting: 55 268 84.0 261 689 Total: 67 292 81.9 283 689 Percentage of the requests served within a certain time (ms) 50% 283 66% 309 75% 329 80% 343 90% 384 95% 436 98% 535 99% 598 100% 689 (longest request) ~~~ Testing CakePHP 1.2.0 : http://localhost/phpmark-read-only/cakephp-1.2.0/benchmark 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/cakephp-1.2.0/benchmark Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.063 seconds Complete requests: 477 Failed requests: 0 Write errors: 0 Total transferred: 123543 bytes HTML transferred: 5247 bytes Requests per second: 15.87 [#/sec] (mean) Time per request: 630.255 [ms] (mean) Time per request: 63.026 [ms] (mean, across all concurrent requests) Transfer rate: 4.01 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 2.9 0 37 Processing: 161 623 94.1 621 972 Waiting: 147 605 98.0 607 949 Total: 178 623 93.9 622 972 Percentage of the requests served within a certain time (ms) 50% 621 66% 653 75% 674 80% 688 90% 732 95% 768 98% 849 99% 896 100% 972 (longest request) ~~~ Testing CakePHP 1.2.1 : http://localhost/phpmark-read-only/cakephp-1.2.1/benchmark 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/cakephp-1.2.1/benchmark Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.098 seconds Complete requests: 479 Failed requests: 0 Write errors: 0 Total transferred: 124061 bytes HTML transferred: 5269 bytes Requests per second: 15.91 [#/sec] (mean) Time per request: 628.349 [ms] (mean) Time per request: 62.835 [ms] (mean, across all concurrent requests) Transfer rate: 4.03 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 13.6 0 109 Processing: 188 619 93.1 621 982 Waiting: 188 602 99.7 608 973 Total: 272 621 91.2 621 982 Percentage of the requests served within a certain time (ms) 50% 621 66% 658 75% 678 80% 692 90% 731 95% 763 98% 821 99% 841 100% 982 (longest request) ~~~ Testing Symfony 1.1.6 : http://localhost/phpmark-read-only/symfony-1.1.6/web/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/symfony-1.1.6/web/index.php Document Length: 541 bytes Concurrency Level: 10 Time taken for tests: 30.150 seconds Complete requests: 380 Failed requests: 0 Write errors: 0 Total transferred: 375820 bytes HTML transferred: 205580 bytes Requests per second: 12.60 [#/sec] (mean) Time per request: 793.432 [ms] (mean) Time per request: 79.343 [ms] (mean, across all concurrent requests) Transfer rate: 12.17 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 13.8 0 106 Processing: 388 781 101.8 777 1193 Waiting: 382 765 105.5 762 1177 Total: 495 783 101.7 777 1193 Percentage of the requests served within a certain time (ms) 50% 777 66% 814 75% 834 80% 848 90% 902 95% 980 98% 1030 99% 1074 100% 1193 (longest request) ~~~ Testing Symfony 1.2.1 : http://localhost/phpmark-read-only/symfony-1.2.1/web/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/symfony-1.2.1/web/index.php Document Length: 541 bytes Concurrency Level: 10 Time taken for tests: 30.105 seconds Complete requests: 304 Failed requests: 0 Write errors: 0 Total transferred: 240160 bytes HTML transferred: 164464 bytes Requests per second: 10.10 [#/sec] (mean) Time per request: 990.280 [ms] (mean) Time per request: 99.028 [ms] (mean, across all concurrent requests) Transfer rate: 7.79 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 3 20.7 0 175 Processing: 703 974 142.6 949 1841 Waiting: 667 958 141.9 938 1807 Total: 703 977 150.6 951 2015 Percentage of the requests served within a certain time (ms) 50% 951 66% 1005 75% 1037 80% 1072 90% 1156 95% 1251 98% 1297 99% 1453 100% 2015 (longest request) ~~~ Testing Symfony 1.2.2 : http://localhost/phpmark-read-only/symfony-1.2.2/web/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/symfony-1.2.2/web/index.php Document Length: 541 bytes Concurrency Level: 10 Time taken for tests: 30.042 seconds Complete requests: 347 Failed requests: 0 Write errors: 0 Total transferred: 274130 bytes HTML transferred: 187727 bytes Requests per second: 11.55 [#/sec] (mean) Time per request: 865.769 [ms] (mean) Time per request: 86.577 [ms] (mean, across all concurrent requests) Transfer rate: 8.91 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 17.8 0 155 Processing: 475 855 106.2 856 1232 Waiting: 473 839 109.8 840 1232 Total: 544 857 108.1 857 1250 Percentage of the requests served within a certain time (ms) 50% 856 66% 895 75% 912 80% 932 90% 984 95% 1026 98% 1137 99% 1219 100% 1250 (longest request) ~~~ Testing Zend 1.6.2 : http://localhost/phpmark-read-only/zend-1.6.2/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/zend-1.6.2/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.029 seconds Complete requests: 712 Failed requests: 0 Write errors: 0 Total transferred: 184408 bytes HTML transferred: 7832 bytes Requests per second: 23.71 [#/sec] (mean) Time per request: 421.757 [ms] (mean) Time per request: 42.176 [ms] (mean, across all concurrent requests) Transfer rate: 6.00 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 9.2 0 97 Processing: 164 418 81.9 414 805 Waiting: 121 393 83.3 390 797 Total: 164 419 81.3 414 805 Percentage of the requests served within a certain time (ms) 50% 414 66% 445 75% 463 80% 474 90% 518 95% 557 98% 622 99% 702 100% 805 (longest request) ~~~ Testing Zend 1.7.2 : http://localhost/phpmark-read-only/zend-1.7.2/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/zend-1.7.2/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.008 seconds Complete requests: 698 Failed requests: 0 Write errors: 0 Total transferred: 180782 bytes HTML transferred: 7678 bytes Requests per second: 23.26 [#/sec] (mean) Time per request: 429.911 [ms] (mean) Time per request: 42.991 [ms] (mean, across all concurrent requests) Transfer rate: 5.88 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 12.5 0 131 Processing: 161 425 84.2 417 884 Waiting: 125 402 83.6 395 884 Total: 208 427 83.0 419 884 Percentage of the requests served within a certain time (ms) 50% 419 66% 446 75% 464 80% 475 90% 514 95% 565 98% 688 99% 753 100% 884 (longest request) ~~~ Testing Zend 1.7.3 : http://localhost/phpmark-read-only/zend-1.7.3/index.php 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 localhost (be patient) Server Software: Apache/2.2.11 Server Hostname: localhost Server Port: 80 Document Path: /phpmark-read-only/zend-1.7.3/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.003 seconds Complete requests: 705 Failed requests: 0 Write errors: 0 Total transferred: 182595 bytes HTML transferred: 7755 bytes Requests per second: 23.50 [#/sec] (mean) Time per request: 425.573 [ms] (mean) Time per request: 42.557 [ms] (mean, across all concurrent requests) Transfer rate: 5.94 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 2 17.0 0 185 Processing: 131 421 88.3 415 828 Waiting: 75 398 91.8 393 828 Total: 131 423 86.8 416 828 Percentage of the requests served within a certain time (ms) 50% 415 66% 446 75% 465 80% 478 90% 519 95% 574 98% 640 99% 752 100% 828 (longest request)
Código Utilizado
KumbiaPHP
Para KumbiaPHP Framework en su version 1.0 Spirit
<?php class HolaMundoController extends ApplicationController { public $template = null; public function index() { $this->render(null); echo 'Hola Mundo'; } }
CakePHP
Para CakePHP en sus versiones 1.2.0; 1.2.1 se utilizo el siguiente código
<?php class BenchmarkController extends AppController { var $helpers = null; //Because the 'Html' and 'Form' helpers are enabled by default var $uses = array(); var $components = array(); var $layout = null; var $autoLayout = false; var $autoRender = false; function index() { echo 'Hello World'; } } ?>
Symfony
Para Symfony en sus versiones 1.1.6, 1.2.1 y 1.2.2.
<?php /** * content actions. * * @package sf_sandbox * @subpackage content * @author Your name here * @version SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $ */ class contentActions extends sfActions { /** * Executes index action * * @param sfRequest $request A request object */ public function executeIndex($request) { echo 'hello world'; } }
Zend Framework
Para Zend Framework en sus versiones 1.6.2, 1.7.2 y 1.7.3
<?php require_once 'Zend/Controller/Action.php'; class IndexController extends Zend_Controller_Action { public function indexAction() { Zend_Controller_Action_HelperBroker::removeHelper('ViewRenderer'); echo( 'hello world'); } }