Welcome Guest, Not a member yet? Register   Sign In
shopping for a scalable php framework


I am looking for a lightweight php framework in which to build a fast and scalable web application. I've done the tutorials and code igniter seems to be what I'm looking for. My problem is that I'm getting some bad results from simple performance tests. I installed MAMP and ran apache bench on a simple static file containing 'Hello World':

ab -n 1000 -c 5 http://localhost:8888/index.html -> 350 requests per second (my laptop is slow)

Next I ran it on a php file containing '<?php print "hello world" ?>':

ab -n 1000 -c 5 http://localhost:8888/test.php -> 250 requests per second

Next I installed code igniter, and did the blog tutorial up to the point where it just prints "hello world":

ab -n 1000 -c 5 http://localhost:8888/index.php/blog -> 20 requests per second!

Using a view and displaying a single db row gets me down to 15 requests per second. Doing the same thing in a simple script gives me 150 rps.

This seems too high a penalty to pay for MVC. Is this a typical result or might there be something wrong with my configuration? I'm otherwise really impressed with this framework and would definitely use it on a smaller project.

Thanks in advance for any help.


508 rps on my macbook (2.16ghz intel duo, 2gb ram) .. I personally don't put too much faith in benchmarks on desktops/laptops, I'd prefer to gauge performance in the intended environment.

Thanks for your reply! I totally agree that it is best to test in target environment. I just thought that these ratios could give me a rough idea of the performance penalty of using the framework. I ran the same series of tests on our development server. It probably have similar capabilities to your macbook. Here's what I got:

static hello world page -> 6500 rps
<?php print "hello world" ?> -> 4000 rps
retrieve one db row -> 1750 rps

CI hello world -> 170 rps
CI retrieve one db row -> 106 rps

I am actually getting comparitively worse performance on the server. Instead of a 10X slowdown, I'm getting more like 20X.

I'm sure there are some configuration things I could be doing. Are you doing anything special to get 500 rps no your laptop, toolwieldingape? Thanks.


You have to remember that you will use page and possibly database caching which will speed up your page loads, look at the site StyleIgnite as this is written with CI (times at bottom of page) and will use caching and possibly eAccelerator or something similar to give you an extra boost. Look at the benchmarks here to compare CI to Cake & Symfony for a hello world comparison.

use this in your controller


where n is the amount of minutes to cache

The gaps in performance will shrink pretty quickly once your app starts to do something interesting, and you'll have the bonus of code that isn't complete spaghetti.

Luci3n: which caching are you using for styleignite? mysql? Ci view caching?

Hi gunter,

I am actually the creator of styleignite. There is no CI caching at all. The speeds you see are a results of eAccellerator and some optimized mysql query cache settings... and a pretty good VPS server.

There's always room for improvement ofcourse so if traffic were to be solidly high then I would probably need to look into view caching of some sort - although it is a bit difficult on a purely dynamic site.

sorry it's not my site it's just an example as it was mentioned here the other day and then it was in delicious hotlist the other day so i remembered it. The code i suggested below is the standard CI chance which is easy to use and also very handy. It's quite a basic caching system but can be implemented very easily.


you got me before i replied

HI woopsicle great site even got to the delicious hotlist

thanks both! I tried once the CI view cache, but I needed to use another view layout assembling because I do it normally with an _output method in the controller (or base controller) but the output generated in the _output method was not to see :-S and I did not know how to include the total benchmark into the page...

Theme © iAndrew 2016 - Forum software by © MyBB