开发者

PHP eAccelerator and real-time data

I have this application written in PHP, I'm considering on using eAccelerator for optimizing the application. My dilemma is that, this application works with real-time data (daily there are around 6 to 8 million reco开发者_StackOverflowrds inserted).

Until now I haven't used any optimizing tool to speed up my applications. So my question is, will eAccelerator cause any problems with real-time data (e.g. display old data instead of the current one)?


No! From the http://eaccelerator.net/ (my emphasis):

eAccelerator is a free open-source PHP accelerator & optimizer. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. ... eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it.

eAccelerator only optimizes and caches your PHP files (thus eliminating most of the usual overhead when compiling static PHP files for each request). Dynamic data (e.g. DB, file system, remote ressources) are not cached (at least, not by eAccelerator). Therefore, your data will still be "fresh" from the requested ressource.

  • Wikipedia: PHP Accelerator

If, at a later point in time, you need to cache (some of) the real-time data (making them not entirely "real time") you could have a look at technologies like Memcached. This is specifically designed "... to reduce the number of times an external data source (such as a database or API) must be read."


if, at a later point in time, you need to cache (some of) the real-time data (making them not entirely "real time") you could have a look at technologies like Memcached.

You can also use eAccelerator for this. See function eaccelerator_put() and eaccelerator_get() here.

EDIT: Too bad, These functions removed from the latest version of eAccelerator 0.9.6.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜