[nycphp-talk] Facebook's LAMP Stack

Hans Zaunere lists at
Thu Apr 23 12:51:10 EDT 2009

> I think this may have been mentioned in the presentation, but one way
> to improve performance is to use an opcode cache like APC (with the
> stat check turned off) so that the included files don't have to be
> recompiled every single time.  The compilation of and the *stat() calls
> for the included files are what takes the longest time.

Yeah, but it's not really always a good solution either.

So way back, when Rasmus joined Yahoo, some of the big improvements that
came from their work on performance was improving and caching the various
stat types of calls.  This included lessening usage of things like
require_once() in favor of things like require().

APC takes it further (with the stat check turned off) by removing the disk
seeks, but there's still an execution path for including the actual file
(pulling in the code, checking to see if it's been included, etc).

What I'd really like is a way to "statically link" a PHP application.  While
this is somewhat possible today, PHP's dynamic nature makes this difficult
to fully realize.  For example, it can be cumbersome on the developer to
check in multiple places if APC is available, what files are cached, what
should be included, etc.

Rather, it'd be great if APC could set a flag that says all files are
included, and we can skip the big chunk of code that includes the other
source files.  Granted, it's more complicated than this, but hopefully it's
somewhat clear as to the overall concept.


More information about the talk mailing list