Performance comparison of web application frameworks

Comparing the throughput of web application frameworks

Referring to cakephper’s articles, I also tried to compare the throughput of the web application frameworks, which are CakePHP, Codeigniter, Ruby on Rails and TreeFrog Framework.

The throughput of retrieving and displaying of one record in RDB was measured.

Note

In this article, "faster" means that the throughput of a framework is higher.

Environment

 Server: Core2 Duo E4500 @ 2.20GHz / 2GB Memory / SATA HDD / 1Gbps Ethernet
  OS: Ubuntu 12.04 (32bit)
  PHP 5.3.10 with APC3.1.7
  Ruby 1.9.3p194
  Apache 2.2.22
  MySQL 5.5.24

 

Schema of ‘posts’ table

CREATE TABLE IF NOT EXISTS `posts` (
 `id` int(11) NOT NULL AUTO_INCREMENT,
 `name` varchar(255) NOT NULL,
 `text` text,
 `created` datetime DEFAULT NULL,
 `modified` datetime DEFAULT NULL,
 PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

 
Beforehand, ten records that contained Japanese’s text were inserted into RDB.
Because I want to measure the speeds of frameworks purely, the number of the records in RDB was reduced to 10 so that RDB processing does not become a bottleneck.

Frameworks

  • TreeFrog Framework 1.0
  • CakePHP 2.2.0
  • Codeigniter2.0.2
  • Rails 3.2.6 (Apache+Passenger+Asset Pipeline ON)
     

Measuring tool

Using the measuring tool Siege, I measured how many times it can process for 3 seconds by simultaneous 10 connections from a remote machine. Measuring is carried out about 10 times every frameworks, and the average of the top three of them was enumerated.

 $ siege -b -c 10 -t 3S http://192.168.x.x/controller/path

 
FYI, Measuring the code written by Plain PHP, the result was 1261 trans/sec.  Amazing!
I found simplistic PHP code is awfully fast.

Result – List

The detailed results are here :
https://docs.google.com/spreadsheet/ccc?key=0AlpTorSDNQjbdEpWTURuRE5TaEtNN0FYbXU5Vl92RUE#gid=0

Result – Graph

The results are as follows. A framework that has higher value is faster.


Measured Aplications

The app codes of CakePHP and Codeigniter are here.

Rails : https://docs.google.com/open?id=0B1pTorSDNQjbT2t3Ylc1Wl9aUzg

TreeFrog Framework : https://docs.google.com/open?id=0B1pTorSDNQjbNldxT1NjbEs4VzQ

   make commands :
    $ qmake "CONFIG+=release" -recursive -spec linux-g++
    $ make

P.S.

About memory usage :
Under high loads, the memory usage of TreeFrog Framework seems to be the lowest of them.

Top command screen on high loads of TreeFrog Framework:

Top
 
Top command screen on high loads of Codeigniter:


Comments are closed.