开发者

High Performance PHP

I am about to launch a CodeIgniter web application. Any recommendations on what I should do to maximize performance of my application? I'm thinking memcached and an acc开发者_JAVA技巧elerator (though I am not sure which one). Suggestions?


To maximize performance, minimizing database requests you must. Denormalize tables before you hack on memory caches. And more importantly run your application through xdebug first, to check out the cachegrind output.


memcached is great, if you need more datatypes Redis is a great alternative too. An Opcode cache like APC could help. PHP 5.3.3's new SAPI (FPM) could help a lot if you don't want to go with the traditional mod_php way.


You can use an accelerator, like APC. Any sort of caching will help if its applied in the right area's.

I would suggest you profile your code runtime using Xdebug and Webgrind in order to find out where its running slowly, and go from there with any optimisations.

You can also do things like move things in your htaccess to the server config and disable htaccess, so that the server isn't wasting time looking in every directory for them.


Performance is a very broad term. As caching is not the only issue. You need to make sure that you have a good database design and structure and that you are querying it in an appropriate and efficient manner.

Also you might want to consider profiling, before you go on to caching, to see if it is indeed faster then regeneration.

Edit:

Have a look at the following benchmarks from AventLabs


you can use both is the simplest answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜