APC Priming

Skip to first unread message

Steve Kamerman

Jun 28, 2011, 2:48:20 PM6/28/11
to HipHop for PHP Dev
Hi all,

I'd like to be able to prime my APC cache on startup but I don't see
any documentation on this.

I can easily generate the key=>value pairs that I would like to use
for priming, but I'm not sure of the format of the prime file. Is
HipHop looking for a file that was previously dumped from the admin /
dump-apc command? If so, I see the contents are like "INT #### KEY
#### VALUE", where INT appears to be an index, KEY is the raw
(string)key and VALUE is the serialized (string)value (looks like PHP
serialize() but I'm not quite sure). If not, what is the format of
the prime file?

I also see apc_load_impl() and apc_load_impl_compressed() defined in
ext_apc.cpp - can I use functions like this inside an HPHP script to
prime the cache? Maybe I'm overthinking the problem, but I generate
the prime data from the shell, and with Apache-PHP-APC, I can't access
the APC data from the CLI because it's a different instance of the
cache. I guess I'll run some tests to see if I can access the HPHP-
APC cache from the CLI by doing program -f test_apc.php or something,
but I'm thinking that will just spawn a new HPHP server instance with
it's own APC cache, then destroy it once the script exits.

Any advice would be great!


Steve Kamerman
Reply all
Reply to author
0 new messages