[phpa] Re: What code benefits from caching?

  • From: "PHP Accelerator" <php_accelerator@xxxxxxxxxxx>
  • To: phpa@xxxxxxxxxxxxx
  • Date: Mon, 01 Oct 2001 21:31:28 +0100

>Hello Nick and fellow PHPA users.
>I am very relieved to see a PHP cache that is both affordable (free!) and 
>trustworthy.  From what I learned browsing around the net, PHP Accelerator 
>seems to be the only cache I can take seriously.

Hi Joe. Thanks for your kind words. There are some alternatives that perform 
well and that offer features that I haven't included yet, but I've 
concentrated on no frills performance and you should be ahead there by a 
fair way.

>I'm currently running PHP 4.0.3 (on Red Hat) and am about to upgrade to 
>4.0.6 (primarily so I can use PHPA).  Before I begin this effort, I'd like 
>to know what PHP code will benefit from caching.  Also, is there any sort 
>of PHP code that will break PHPA?

Not that I'm aware of, but you do break it then please be sure to let me 
know :-)

One user reported that using PHP as a standlone program eventually caused, 
if I remember correctly, a problem with the web server, although I need to 
look again at that report as it confuses me.

The main potential problem is that if Apache crashes (and PHP 4.0.6 has some 
bugs that can cause it to segv), locks on the shared memory that the crashed 
server had made may not be released. This will mean that either no more 
cached files can be written, or no more can be read. In this case the shared 
memory must be reset by the flush_phpa_cache script and the server 
restarted.  I will most likely include a solution to this in a future 
release as it's the thing that bothers me the most.

>Does anyone have any recommendations for how to maximally benefit from PHPA 
>caching?  How should I organize my code?  Have all of the above scenarios 
>been tested?

The ways you intend to code should give you no problems.

Part of the benefit of the cache is that you don't have to specially think 
about how to organise your code for performance other than just following 
good design principles. Whilst conditionally including code can make a big 
difference without a cache, it can make your code more complex and harder to 
maintain. As there's no parsing of cached files and accessing a cached file 
in shared memory is very efficient, you don't need to make special efforts 
in an attempt to gain performance.

>Thank you so much for your help!

You're welcome and I hope you find phpa useful!


Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

  www.php-accelerator.co.uk           Home of the free PHP Accelerator

To post, send email to phpa@xxxxxxxxxxxxx
To unsubscribe, email phpa-request@xxxxxxxxxxxxx with subject unsubscribe

Other related posts: