for (let like of ['tech','web','aws','dev','oss']) blog(like)

cakephp 1.3 and php 5.3 performance improvement

I’ve been doing some profiling of my cake apps. Found a decent improvement.

For your production apps only

in core.prod.php change

Configure::write(‘log’, true);

to

define(‘DISABLE_DEFAULT_ERROR_HANDLING’,1);

Configure::write(‘log’, E_ERROR | E_WARNING);

You don’t even know it (cuz it never logs) but because cake has backwards compatibility with php4, there are tons of notices and strict notices thrown that cake swollows. Thing is, there are 300+ of these every request – thats 300+ extra method and stack increases each request. The downside of my “fix” above is PHP warnings/errors will no longer be written to the tmp/logs/error.log – instead it will go to the generic php5-fpm /var/log log. Which to me is way worth the perf increase.

I opened a ticket u can read if u want more info – this should be a no-issue in cake 2.0.

One thought on “cakephp 1.3 and php 5.3 performance improvement”

Nice! My app went from ~30 req/s to 35 req/s by disabling Cake’s error logging.I got an error when running shell tasks about DISABLE_DEFAULT_ERROR_HANDLING already being defined, but found it isn’t necessary to define the constant to get the nice speed bump 🙂