[phpa] Re: files needed if using shm too?

> 
> Hi there,
> 
> I was just wondering, 'cause I used APC before ... 
> if I use the shmmode ... why do phpa still needs the files in
> its tmp-directory? all the data is stored in shm-segments afaik.?

Hi Thomas,

Historical reasons. After the first two weeks of developing phpa I had a 
cache that used files. Then I went from there to get the best performance. 
The files don't need to be there, but there are some potential benefits 
from having them, and I've just never had time to take them out. Plus they 
would form the basis of an encoder if there ever was one.

> By the way ... for the first tests I didn't see a speed increase in the
> use of phpa against no acceleration but perhaps the load is simply too
> low on a completely unloaded server which I prepare for now.
> I tested with 'ab -c 10 -n 10000 ...' and there were only marginal
> differences (around 5-10%) in all directions.

It's possible that something's either wrong with the tests/setup, the 
scripts are too trivial, or simply execution far outweighs loading time. 
There's certainly likely to be something wrong if APC gave you better 
performance. You might get similar performance. You don't indicate what 
tests you did, but for 'real world' cases, where there can be many includes 
and perhaps large scripts involved for a single request, there almost 
always seems to be at least 2 to 3 times acceleration. Smarty can be more 
like 6 to 9 times. 

It would be worth checking your apache errors log for any warnings, and 
also enabling shm logging. If phpa was unable to initialise an shm cache 
then it will still work with the file cache, but you'll just get less 
acceleration.

If you have very small files then acceleration won't be so noticable 
either. I tried a hello world example on one of my machines, using ab, and 
with concurrency 4. Without phpa I had 560#/sec. With I had 600#/sec, so 
there's your 10% gain.  But running it on the index.html from the phpa site 
I get 34.5#/sec without phpa, and 95#/sec with phpa, so there's a 2.75 
times increase. 

A further factor is the size of the cache. The default is 8MB, but if your 
scripts require more cache than that then you'll get performance hits. 
Using the phpa_cache_admin tool, and especially with Hannes Edingers gui 
front end, is a useful way to determine cache utilisation and to help 
sizing the cache. Enabling shm_logging as mentioned before and checking for 
indications of running out of shm space is also useful if memory gets tight.

nick



------------------------------------------------------------------------
  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: