Solid information about opcode caching with PHP-FPM?

[email protected] (Geoff Caplan)
Newsgroups php.install
Message-ID <[email protected]>
Hi folks

Thinking of moving from mod_php to a lighter-weight option like Hiawatha 
or Nginx, but googling the issue of opcode caching with fastcgi is 
proving surprisingly confusing: there's a lot of conflicting information 
out there.

My basic question is this: what is the most performant, 
memory-efficient, Slashdot-resistant way to set up PHP-FPM for a complex 
PHP app that runs a lot of code?

More specifically:

1) Why cache? I understood that a fastcgi process compiles the app into 
memory, and serves it from there till it's recycled after max_requests. 
So what's the value of opcode caching? To speed up one request in 500? 
But I've seen benchmarks that claim an opcode cache with fastcgi offers 
50% savings on memory and response time. Where would these savings be 
coming from? No one explains...

2) What cache? For example Nginx/PHP setup tutorials either omit opcode 
caching or recommend xcache, without explaining why. There's a lot of 
conflicting information about whether each process needs its own cache 
(very memory intensive?) or whether processes can share a cache. Some 
bloggers claim that Xcache handles this better than APC, but again, no 
one explains how or why. Can anyone offer an authoritative answer to this?

So is opcode caching effective with fastcgi? If so, how does it work, 
and what is the best setup? I would be more than grateful if anyone can 
make sense of this.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.