tags:

views:

83

answers:

3

I've seen DooPHP is the world fastest MVC framework and I intend to consider this for building mission critical website which is able to handle over 100,000 concurrent users.

I have to build my website from scratch on shared hosting and run CPanel on VPS which use Apache 2.0.x with PHP 5.2.14 and MySQL. Performance wise, does it make a lot of difference when coding PDO(access database)+PHP vs DooPHP?

+3  A: 

Technically, not using a framework should always be faster because you are writing code only for what you need.

That is assuming you are well versed with PHP however, and know how to write good code.

A framework will cut down on development time.

If performance is a key issue, look into caching opcodes, server side caches, far distant expiry headers, CSS spriting, etc, etc (there is a lot).

alex
+2  A: 

You ask a big question and the philosophical answer is that no two environments are alike and no two sets of requirements or toolkits are alike. "Fastest" here reflects development time but not performance. Those questions must be answered with benchmarking.

Answer: don't commit the sin of optimizing before the program is complete.

Answer #2: but kinda pay attention to performance as you go along.

Ignore the toolkit for a second and look at just PHP and the machine. Best thing you can do is optimize the server and then pay attention to rest. On that server level, I will address only caching and the memory footprint here - and show the measured trends before / after on a PHP environment.

One of interesting side-effects of using opcode caching is a smaller memory footprint. That, in turn, gives you an ability to scale upwards. Machine, while being hammered, has more memory to deal with instantaneous requests and has more time to recover from swap borrows.

This graph below is a bit confusing (and clipped) but what it shows is unoptimized vs optimized memory footprint. The lowest ledge is the post-optimization memory footprint.

alt text

Long axis is an abstract type of page (home vs post vs page vs etc..) going from common, simple to complex. The other axis is caching off, no opcode caching to caching on, opcode caching on.

This illustrates that you can make great improvements by recompiling PHP/Apache to use opcode caching alone. It's probably the biggest optimization gain with least amount of effort and you don't have to be aware that you're using a templating language within a toolkit that runs as a runtime substitute for C which is a compilation enhancement over machine code. (Insert more hair-splitting nerdyness here...)

After this particular optimization, the machine was able to take far more burst traffic (from 200 requests per hour to 700 easily).

Good luck.

pp19dd
Excellent answer...
Codex73
A: 

DooPhp is certainly one of the fastest php frameworks in terms of performance around. Unless your website has incredibly basic functionality you should forget about using just straight php without any kind of framework.

If your website has even beyond basic functionality required the code you create to run it is unlikely to be as well thought out as a framework like DooPhp in terms of practicality and speed.

Apache and Cpanel can unnecessarily slow things down from the beginning. MySql or any DB ultimately ends up being the bottle neck especially when it comes to ORM.

How to get even better performance from your box:

  1. Ditch Apache and Cpanel and replace with Nginx/Php-fpm
  2. Install memcache and php apc and use Nginx FastCgi Cache.
  3. Design a good database schema with well thought out indexing
  4. Optimize your MySql queries via benchmarking
  5. Use a framework like DooPhp which has all the basic functionality you need without the bloat.
Hone Watson