Welcome Guest, Not a member yet? Register   Sign In
CI-based Web Sites Performance
#1

[eluser]Edemilson Lima[/eluser]
I would like to know from the people here, that already have one or more web sites made with CodeIgniter, about its performance.

- Is your web site small, medium or big? How 'heavy' you think it is?
- How fast is it? How much time it takes to load the front page? How much time it takes to load when you click a link?
- How many simultaneous users your web site can tolerate?
- Is your hosting shared or dedicated? If shared, have it limitations? If dedicated, which is your server's configuration (CPU, memory, hard disk, etc)?
- How much server's memory is your application using for all simultaneous requests?
- Are you using CI cache?
- Are you using any PHP cache like XCache, eAccelerator or APC?
- Are you using sessions? Which kind of session are you using: cookie, PHP native or database?
- Does your web site builds all the pages from a database or is mostly static content?
- Are you using Active Record or raw queries?
- Are you using a template parser or only pure PHP code?
- Is there something special you did to get more performance when your web site access hit the sky?
- Do you think CI gives you more performance than the old way you made your applications? Why?
- What do you think about your CI-based web site running in a cluster configuration? Will it work fine?
- Is there something more you would like to say about the framework performance?
- Do you know something faster or lighter than CodeIgniter?

Well, I know this is a lot of questions...
Please answer only the ones that apply to you, you know the answer or you want to.
Your comments will be very valuable!
#2

[eluser]Référencement Google[/eluser]
I have made some websites with CI, and also 1 with Kohana CI fork.
That's the feedback I can give to you:

- Is your web site small, medium or big? How ‘heavy’ you think it is?
Some small, some medium websites and medium heavy.

- How fast is it? How much time it takes to load the front page? How much time it takes to load when you click a link?
It is fast, I can even say, very fast. I don't measure the time it takes to load, but I can say it's less than 2 seconds to load really all.

- Is your hosting shared or dedicated? If shared, have it limitations? If dedicated, which is your server’s configuration (CPU, memory, hard disk, etc)?
Dedicated VPS, virtualization by XEN. 512Mo of RAM, intel dual core 2Ghz, 10Go of hard drive, 200Go / month of traffic is included

- Are you using CI cache?
I will have to give it a try but actually not using it since it can't cache only partials.

- Are you using any PHP cache like XCache, eAccelerator or APC?
No

- Are you using sessions? Which kind of session are you using: cookie, PHP native or database?
For some apps native session, for some DB session

- Does your web site builds the all the pages from a database or is mostly static content?
It is mixed, depends the need of the application. I can say, if the content needs to be edited I go directly with a DB, however I try not to use the DB if it's not really needed.

- Are you using Active Record or raw queries?
At the begining I was using CI, I was using raw queries, but using some kind of $this->db->query('SELECT * FROM mytable') Then on the last application I've build, I have been using only active record (only a few complex queries was built manually since active record was not able to do them)

- Are you using a template parser or only pure PHP code?
Pure PHP <?=$var?>

- Is there something special you did to get more performance when your web site access hit the sky?
I actually don't had to face this case yet. But if it would happen, I will try to optimize the DB queries a maximum, then try to refactor some parts of code that I knew can be slowly (For example during developpement I note a TODO comment in some code that I know it can be done better but don't have time right now to do it) If it's not sufficiant, the next step would be to implement a cache system and some PHP optimizer.

- Do you think CI gives you more performance than the old way you made your applications? Why?
Yes, more structure in the application, more organized, a common way to do things and not reiventing the wheel each time or rely on classes that I just found, ... The performance gain is not for the PHP script speed, but it's really on the Framework concept itself.

- Do you know something faster or lighter than CodeIgniter?
I tryed for a month to use Kohana that claim to be faster, but unfortunally, it is not. Maybe it is on the benchmark of some code, but the user feeling looks like it's heavy to load, I came back to CI then.
#3

[eluser]tonanbarbarian[/eluser]
too many questions for me to answer
but i will talk briefly on my thoughts on this

I have test CI and compared it to CakePHP. I am also an experienced Joomla! developer.
CI is way faster than CakePHP and Joomla! and uses less memory. Of course CI is not a CMS like Joomla! so it is not a straight comparison.

As far as coding frameworks CI is the fastest and lightest I have seen.

But if you are unsure I suggest you compare some yourself.
#4

[eluser]Chris J Smith[/eluser]
Interesting thread.

This is somewhat predicted and somewhate tested. We're not live yet!

Is your web site small, medium or big? How 'heavy' you think it is?

Medium. We're taking on 37signals' rubbish. Death to rails, death to hype!

How fast is it? How much time it takes to load the front page? How much time it takes to load when you click a link?

Always < 1 sec on 1Mbit pipe.

How many simultaneous users your web site can tolerate?

Target is 50 requests per second for scaleout phase 1.

Is your hosting shared or dedicated? If shared, have it limitations? If dedicated, which is your server's configuration (CPU, memory, hard disk, etc)?

Dedicated - Custom 2x 2.4GHz Xeon, 4096Mb RAM, 2x 76Gb WD Raptor.

How much server's memory is your application using for all simultaneous requests?

No idea - the thing has 4Gb of memory in it though (mainly for memcache and mysql from day 1 - we really have bigger problems than PHP memory usage)

- Are you using CI cache?

No we're using memcache - need something scalable if I need to scale up quickly.

- Are you using any PHP cache like XCache, eAccelerator or APC?

APC.

- Are you using sessions? Which kind of session are you using: cookie, PHP native or database?

Not really. We have a cookie stores a GUID session token. This is recovered and the user and tenant retrieved per hit (mainly from memcache).

- Does your web site builds the all the pages from a database or is mostly static content?

All pages are dynamic. Heavy caching stops us from hitting the database too hard.

Are you using Active Record or raw queries?

Raw queries - they are easier to tune.

Are you using a template parser or only pure PHP code?

Pure PHP.

Is there something special you did to get more performance when your web site access hit the sky?

Celebrate?! Not hit that yet!

Do you think CI gives you more performance than the old way you made your applications? Why?

No - it is significantly cheaper to build and deploy with though which makes its performance a good trade-off versus cost.

What do you think about your CI-based web site running in a cluster configuration? Will it work fine?

It will work fine - we've tested it on VMware server ;-)

Is there something more you would like to say about the framework performance?

Do you know something faster or lighter than CodeIgniter?

ASP.Net with SQL 2005 destroys it on every level but that's PHP and MySQL's fault, not code igniter. Unfortunately SQL2005 is prohibitively expensive both in initial cost and staffing.
#5

[eluser]tonanbarbarian[/eluser]
If you want to get some real performance data on your CI site turn on the profiler
in your controller put the following code
Code:
$this->output->enable_profiler(true);
This will display the execution time for CI, which is a better indication of speed than "it took less than a second to download" because download speed is subjective depending on your internet connection, the servers internet connection and the load on the server.

The profiler also shows all queries that were run, and the get and post variables, and in CI 1.6 it will show the memory used, if your PHP is complied with memory limiting enabled.

This gives you a good idea as to how well your site is running.
On modest hardware you should find your execution times way less than 1 seconds, in fact they may even be less than .1 seconds, but it all depends on what you are doing in code.

If you want even more information about what your site is doing add the following code to the end of your index.php file
Code:
echo '<pre>'.print_r(get_included_files(), true).'</pre>'
This will list out each of the files loaded. Ideally you want the number of files loaded to be as small as possible it you want the best performance. If coded properly then CI is good at this. So do not use autoload unless you really need it, instead tell CI to load things only as you need them, and do not worry about trying to load the same thing more than once, CI handles that correctly. If you do this you may find that your number of included files goes down, which should also improve memory and execution time.
#6

[eluser]Edemilson Lima[/eluser]
Thank you for the tips tonanbarbarian! Well, I did open this thread to hear from people about real cases. I am sure CI is the best PHP framework out there. I just want to know how really fast it is.
#7

[eluser]tonanbarbarian[/eluser]
It is so fast I build extensions for the Joomla! CMS in CI and integrate them

I did some comparison between Cake 1.1, Cake 1.2 and CI 1.5
In each I built a simple form to list all of the records in a table paginated
Same data in each case.

Cake 1.1 4M of memory used to display the page
Cake 1.2 5M of memory to display
CI 1.5.4 1.2M of memory
And in fact the CI version of the code had a few extra features in it.

I do not remember the exact execution times but CI was way faster than Cake as well
#8

[eluser]DragonI[/eluser]
Hi tonanbarbarian,

I'm currently using Cake 1.2. Just wondering how you can determine the amount of memory being used?

Thanks!
#9

[eluser]tonanbarbarian[/eluser]
i think i just turned debugging on in cakes config
but the other way to do it as add the following at the end of the index.php
Code:
echo (memory_get_usage()/1048576);
You have to have php compiled with --enable-memory-limit
Cake is a huge resource hog because of all of the automagic
#10

[eluser]johnwbaxter[/eluser]
Chris J Smith, is ASP.net really that much quicker or is it SLQ 2005 where the real speed gain is?




Theme © iAndrew 2016 - Forum software by © MyBB