1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00
phorge-phorge/scripts
epriestley a3028558ae Make includes free to the user (application support component)
Summary:
We spend a significant amount of time running includes, even with APC. However, we have rigidly structured includes and can safely run them all in workers before requests occur.

Right now, requests go like this:

  - Apache spawns a worker.
  - Client sends an HTTP request.
  - Apache interprets it.
  - Apache sees it's ".php", so it hands it off to the PHP SAPI.
  - The PHP SAPI starts the PHP interpreter in the worker.
  - The request is handled, etc.

Instead, we want to do this:

  - Worker spawns and loads the world.
  - Client sends an HTTP request.
  - Webeserver interprets it.
  - Sees it's a ".php", hands it off to the SAPI.
  - SAPI executes it on a loaded world.

No SAPIs I know of support this, but I added support to PHP-FPM fairly easily (in the sense that it took me 6 hours and I have a hacky, barely-working mess). Over HTTP (vs HTTPS) the performance improvement is pretty dramatic.

HPHP doesn't significantly defray this cost so we're probably quite a bit faster (to the user) under nginx+PHP-FPM than HPHP after this works for real.

I have the php-fpm half of this patch in a messy state, I'm going to try to port it to be vs php 5.4.

Test Plan: Ran a patched php-fpm, browsed around, site works, appears dramatically faster.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D2030
2012-03-27 16:06:13 -07:00
..
aphront Use PhabricatorEnv::newObjectFromConfig() wherever possible 2012-03-21 14:57:52 -07:00
conduit Encode "<" and ">" in JSON/Ajax responses to prevent content-sniffing attacks 2012-02-14 14:51:51 -08:00
daemon Merge __init_env__.php into __init_script__.php 2011-10-02 11:48:09 -07:00
drydock More Drydock Stuff 2012-03-26 20:54:26 -07:00
fpm Make includes free to the user (application support component) 2012-03-27 16:06:13 -07:00
install Minor, remove metamta reference from update script. 2012-03-02 06:42:31 -08:00
mail Provide upgrade script for transition away from Meta MTA daemon 2012-03-05 15:15:19 -08:00
repository Provide a script to "undo" the negative effects of an accidental push in Differential 2012-03-13 11:18:22 -07:00
search Merge __init_env__.php into __init_script__.php 2011-10-02 11:48:09 -07:00
setup Test for pcntl availability from the command line, not Apache 2011-05-30 21:02:08 -07:00
sql Add a little SQL-info script that is sort of useful maybe? 2012-03-15 14:16:40 -07:00
symbols Project symbol import from 'ctags' 2012-03-25 09:50:42 -07:00
user Unify logic for username validation 2012-01-16 11:52:59 -08:00
util Add a script to programmatically add image macros 2012-03-09 08:55:11 -08:00
__init_env__.php Fix __init_script__.php issue with event engine. 2011-09-30 13:17:45 -07:00
__init_script__.php Use libphutil script initializer to initialize scripts in Phabricator 2012-03-19 19:21:10 -07:00
celerity_mapper.php Stabilize sort in celerity map 2012-03-15 11:08:14 -07:00