Page MenuHomePhabricator

Make xhpast and xhprof binaries automatically deploy in the Phacility cluster
Closed, ResolvedPublic

Description

Currently, the xhpast binary and the xhprof extension aren't automatically deployed as part of host deployment. This causes minor inconveniences:

  • If the load balancer sends a diff rendering request to a server without xhpast, you get a less-accurate highlight of the source back.
  • If the load balancer sends a request to a server which is missing xhprof, you can't profile the page from DarkConsole.

secure should get xhprof and all hosts should get xhpast.

Revisions and Commits

Event Timeline

epriestley added a commit: Restricted Diffusion Commit.Dec 8 2016, 3:26 PM

For future reference, here's the sequence of problems I hit:

  • If we have bin/host upgrade overwrite xhprof.so, we segfault on exit. (We are a PHP process overwriting a library we have loaded.) It's vaaaguely possible this is an XHProf problem, but I think it's probably more of a "don't overwrite C libraries at runtime" problem.
  • If we use /usr/bin/env php -n on bin/host to disable loading extensions, it works fine when you're testing on Mac OS X but tries to run the binary "php -n" on Ubuntu. Apparently there is no real fix for this and this is just a Unix boneyard that will never have consistent behavior.
  • If we use /usr/bin/php -n explicitly, things work but then it turns out we need MySQLi anyway.
  • Instead, just don't try to load XHProf from the CLI. In the rare case we need it, you can php -d extension=xhprof.so -f bin/whatever -- arg arg to explicitly run with the extension, or just make a temporary modification to php.cli.ini since you're profiling stuff in a production cluster anyway so you're already in waist-deep.

Seems to be working now. ¯\_(ツ)_/¯