Mobile Apps Platform

Web Apps Platform

Online Business

Server and Hosting

CMS Applications

Marketing

Design

Web Application Frameworks, Comparison and Benchmarks

Glue Framework vs Full Stack Framework, Performance and Benchmark Comparison of PHP MVC Frameworks: Comentum Framework, CodeIgniter, Zend Framework, CakePHP, Yii, Kohana, DooPHP

What is a Web Application Framework

A Web Application Framework is a patterned code system consisting of common program libraries and tools providing an organized environment for developers to program and help to create structured, maintainable code. Using a Web Application Framework provides the following advantages:

  • Organized and structured programming environment creates maintainable code — it will be easier to make updates or changes to the code or have new programmer(s) or programming team(s) take over the Web Application project maintenance.
  • Promotes writing a function (or class) once and reusing it in different parts of the Web Application instead of repeating the same function in different places. So, if there is a need to change the function, it can be done in one place instead of having to change it in several places.
  • Provides a better environment for multiple programmers to work on the Web Application Project.
  • By separating the HTML and CSS from the PHP code, HTML and CSS designers can work on the design (refereed to "view") folder without having to deal or tinker with the PHP code.
  • Most frameworks come with the common functionalities (classes, helpers, and libraries), such as database access, form input security checks, validating forms, uploading photos, sending emails, etc. — those common libraries provide an streamlined and fast method of coding without having to rewrite code for common functions.
  • Provides better beta testing and bug fixing environment — it promotes testing one functionality at a time, instead of testing the whole Web Application which usually causes programmers to miss programming bugs.

What is Model View Controller (MVC)

Web Application Frameworks are organized in a structural pattern — this promotes better code organization and code reuse.

In a Model View Controller (MVC) pattern, the code is organized in three different sections:

  • Model — data interfacing — this is where the data updates are occurring — the developer writes the function in the Controller referencing a function in the Model telling it to save the user's submitted information to the database.
  • View — user interface — this is where the application interface such as HTML and CSS exist and are managed. For example a Contact Us form.
  • Controller — application interaction — this is where the application actions are occurring such as a function that takes the user's submitted information and processes it. s

Different types of MVC Framework

Glue Framework — More Flexible
Glue frameworks provide an environment with a wide variety of components and libraries, and the programmers have the control of the structure and flow of the program actions, and can pick and choose any library or component at their own discretion.

In my opinion, Glue Frameworks provide a better environment for custom Web Applications with complex business logic. In most of today's custom business Web Applications, there are a lot of complex business logic requirements and many exceptions to the rules functions — it is much easier to implement custom, complex logic into a Glue Framework.

Below are some examples of Glue Frameworks:
  • Comentum Framework
  • Zend Framework
  • Codeigniter Framework

Full Stack Framework — Strict and Less Control
Full Stack Frameworks provide an environment with libraries and components that are integrated, forcing programmers to use most of the libraries and components based on the framework's structural flow and guidelines.

In my opinion, Full Stack Frameworks provide a better environment for common Web Applications that do not need much customization and do not have lots of complex business logic.

Below are some examples of Full Stack Frameworks:
  • CakePHP
  • Symfony

Performance

Comentum used Apache Bench to test the performance of different PHP Frameworks and below are the results (this test was run on November 9, 2012).

Hardware:
CPU: Xeon Quad Core X3220 (2.4 Ghz)
RAM: 4GB

OS and Server:
CentOS 6.2 x86_64
Apache 2.2.15

Request Per Second - More is Better

PHP Framework Requests Per Second
PHP Framework Requests per second
Comentum Framework 1449.87
DooPHP Framework 762.95
CodeIgniter Framework 468.21
Yii Framework 302.99
Kohana Framework 301.46
CakePHP Framework 133.94
Zend Framework 70.50

Requests Completed - More is Better

PHP Framework Requests Completed
PHP Framework Requests Completed
Comentum Framework 43515
DooPHP Framework 22890
CodeIgniter Framework 14048
Yii Framework 9090
Kohana Framework 9045
CakePHP Framework 4020
Zend Framework 2115




------------------- Comentum Framework ------------------------------

# ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/ComentumFramework/

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 ecommercesoftwareinfo.com (be patient)
Completed 5000 requests
Completed 10000 requests
Completed 15000 requests
Completed 20000 requests
Completed 25000 requests
Completed 30000 requests
Completed 35000 requests
Completed 40000 requests

Finished 43515 requests


Server Software:        Apache
Server Hostname:        ecommercesoftwareinfo.com
Server Port:            80

Document Path:          /frameworkbenchmarks/ComentumFramework/
Document Length:        11 bytes

Concurrency Level:      10
Time taken for tests:   30.013 seconds
Complete requests:      43515
Failed requests:        0
Write errors:           0
Total transferred:      25326250 bytes
HTML transferred:       478665 bytes

Requests per second:    1449.87 [#/sec] (mean)

Time per request:       6.897 [ms] (mean)
Time per request:       0.690 [ms] (mean, across all concurrent requests)
Transfer rate:          824.07 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       3
Processing:     2    7   5.3      6     291
Waiting:        1    6   5.3      6     291
Total:          2    7   5.3      6     291

Percentage of the requests served within a certain time (ms)
  50%      6
  66%      7
  75%      7
  80%      8
  90%      9
  95%     10
  98%     12
  99%     13
 100%    291 (longest request)

------------------------------ DooPHP -------------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/DooPHP/app/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 ecommercesoftwareinfo.com (be patient) Completed 5000 requests Completed 10000 requests Completed 15000 requests Completed 20000 requests Finished 22890 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/DooPHP/app/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.002 seconds Complete requests: 22890 Failed requests: 0 Write errors: 0 Total transferred: 3684920 bytes HTML transferred: 251790 bytes Requests per second: 762.95 [#/sec] (mean) Time per request: 13.107 [ms] (mean) Time per request: 1.311 [ms] (mean, across all concurrent requests) Transfer rate: 119.94 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 6 Processing: 5 13 4.4 12 46 Waiting: 0 12 4.2 11 46 Total: 5 13 4.4 12 46 Percentage of the requests served within a certain time (ms) 50% 12 66% 14 75% 15 80% 16 90% 19 95% 21 98% 25 99% 28 100% 46 (longest request) --------------------------- CodeIgniter ------------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/CodeIgniter/ 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 ecommercesoftwareinfo.com (be patient) Completed 5000 requests Completed 10000 requests Finished 14048 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/CodeIgniter/ Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.003 seconds Complete requests: 14048 Failed requests: 0 Write errors: 0 Total transferred: 2075216 bytes HTML transferred: 154528 bytes Requests per second: 468.21 [#/sec] (mean) Time per request: 21.358 [ms] (mean) Time per request: 2.136 [ms] (mean, across all concurrent requests) Transfer rate: 67.54 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 8 21 7.9 20 76 Waiting: 7 19 7.6 18 75 Total: 8 21 7.9 20 76 Percentage of the requests served within a certain time (ms) 50% 20 66% 23 75% 25 80% 27 90% 32 95% 36 98% 42 99% 46 100% 76 (longest request)

-------------------------------- Yii ----------------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/yii/demos/helloworld/ 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 ecommercesoftwareinfo.com (be patient) Completed 5000 requests Finished 9090 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/yii/demos/helloworld/ Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.001 seconds Complete requests: 9090 Failed requests: 0 Write errors: 0 Total transferred: 1463460 bytes HTML transferred: 99990 bytes Requests per second: 302.99 [#/sec] (mean) Time per request: 33.004 [ms] (mean) Time per request: 3.300 [ms] (mean, across all concurrent requests) Transfer rate: 47.64 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 4 Processing: 12 33 13.5 31 114 Waiting: 11 31 13.1 29 112 Total: 12 33 13.5 31 114 Percentage of the requests served within a certain time (ms) 50% 31 66% 37 75% 41 80% 44 90% 52 95% 58 98% 66 99% 71 100% 114 (longest request)

------------------------------- Kohana --------------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/Kohana/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 ecommercesoftwareinfo.com (be patient) Completed 5000 requests Finished 9045 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/Kohana/index.php Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.004 seconds Complete requests: 9045 Failed requests: 0 Write errors: 0 Total transferred: 1387332 bytes HTML transferred: 99506 bytes Requests per second: 301.46 [#/sec] (mean) Time per request: 33.172 [ms] (mean) Time per request: 3.317 [ms] (mean, across all concurrent requests) Transfer rate: 45.15 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.4 0 18 Processing: 12 33 12.9 31 115 Waiting: 7 30 12.2 29 114 Total: 13 33 12.9 31 115 Percentage of the requests served within a certain time (ms) 50% 31 66% 37 75% 41 80% 43 90% 51 95% 57 98% 63 99% 69 100% 115 (longest request)

-------------------------------- CakePHP ------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/CakePHP/ 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 ecommercesoftwareinfo.com (be patient) Finished 4020 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/CakePHP/ Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.013 seconds Complete requests: 4020 Failed requests: 0 Write errors: 0 Total transferred: 602180 bytes HTML transferred: 44220 bytes Requests per second: 133.94 [#/sec] (mean) Time per request: 74.659 [ms] (mean) Time per request: 7.466 [ms] (mean, across all concurrent requests) Transfer rate: 19.59 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.1 0 2 Processing: 27 74 22.3 75 173 Waiting: 25 69 21.7 70 173 Total: 27 74 22.3 75 173 Percentage of the requests served within a certain time (ms) 50% 75 66% 84 75% 89 80% 93 90% 103 95% 110 98% 120 99% 128 100% 173 (longest request) ----------------------------------- Zend Framework ---------------------------------------- # ab -t30S -c10 http://ecommercesoftwareinfo.com/frameworkbenchmarks/ZendFramework/public/ Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking ecommercesoftwareinfo.com (be patient) Finished 2115 requests Server Software: Apache Server Hostname: ecommercesoftwareinfo.com Server Port: 80 Document Path: /frameworkbenchmarks/ZendFramework/public/ Document Length: 11 bytes Concurrency Level: 10 Time taken for tests: 30.000 seconds Complete requests: 2115 Failed requests: 0 Write errors: 0 Total transferred: 340914 bytes HTML transferred: 23287 bytes Requests per second: 70.50 [#/sec] (mean) Time per request: 141.846 [ms] (mean) Time per request: 14.185 [ms] (mean, across all concurrent requests) Transfer rate: 11.10 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 52 141 39.0 147 251 Waiting: 49 138 38.5 144 251 Total: 52 141 39.0 147 251 Percentage of the requests served within a certain time (ms) 50% 147 66% 161 75% 169 80% 173 90% 187 95% 196 98% 211 99% 220 100% 251 (longest request)

----------------------------------------------------------------------------------

Research for this article was completed November 9, 2012; pricing and other information may change.

Joseph Montanez - Web Application Development Expert

Joseph Montanez is a senior web application developer, team manager, and technology analyst expert at Comentum.

 

Bernard Kohan

Bernard Kohan is a mobile app and web application development and technology analyst expert. He is available to discuss any issues or questions you have about web development and the best choices for your company or project.

Bernard can be reached at
619-990-1212


Contact Us »

Web App Estimator

Select and unselect modules such CMS or eCommerce for your web application and watch the cost update in real time.

Try It »