[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/scripts/fpm/ -> warmup.php (summary)

(no description)

File Size: 38 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 function

  __warmup__()

Functions
Functions that are not part of a class:

__warmup__()   X-Ref
NOTE: This is an ADVANCED feature that improves performance but adds a lot
of complexity! This is only suitable for production servers because workers
won't pick up changes between when they spawn and when they handle a request.

Phabricator spends a significant portion of its runtime loading classes
and functions, even with APC enabled. Since we have very rigidly-defined
rules about what can go in a module (specifically: no side effects), it
is safe to load all the libraries *before* we receive a request.

Normally, SAPIs don't provide a way to do this, but with a patched PHP-FPM
SAPI you can provide a warmup file that it will execute before a request
is received.

We're limited in what we can do here, since request information won't
exist yet, but we can load class and function definitions, which is what
we're really interested in.

Once this file exists, the FCGI process will drop into its normal accept loop
and eventually process a request.



Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1