Re: APC & Custom streams
| From: | Greg Beaver | Date: | Mon, 26 Sep 2005 02:49:49 +0000 |
| Subject: | Re: APC & Custom streams | ||
| References: | 1 2 3 4 5 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2998@lists.php.net to get a copy of this message | ||
Sara Golemon wrote:
>>>Do I understand you to mean that *if* a wrapper implements url_stat()
>
> and
>
>>>*if* the stat_buf is populated with, at minimum, those three elements
>
> that
>
>>>APC will cache?
>>
>>I don't use a wrapper here. The code in question is in
>>pecl/apc/apc_cache.c and it looks like this:
>>
>
> [...snip...]
>
>>So, for the top-level script I get the stat struct from Apache via
>>sapi_get_stat(). For included files I use apc_stat() which just does a
>>normal stat() call. This would have to be changed to use the wrapper
>>code for it to have any chance of working.
>>
>
> Roger. Anyway, the "gain" of including wrapped streams is probably small
> compared to the cost of issuing url_stat()s, just wanted to be clear. One
> thing this does mean though is that the payload portion of PHARs won't be
> cached.
Because of this, PHP_Archive implements a run-time memory-based cache.
So, to use a .phar like install-pear.phar, memory_limit might be an
issue, depends on how much space each of the files takes in memory.
It would be really easy to simulate the inode/mtime stuff in PHP_Archive
if APC was modified to use the wrapper code, incidentally. As long as
that data is only used to generate a hash, and not to attempt to access
the thing directly, there is no issue at all.
Greg