]> khamidou — GitHub mirrors - arcanist.git/commit
Add various flags to the HgProxy daemons
authorepriestley <git@epriestley.com>
Tue, 26 Jun 2012 18:00:26 +0000 (11:00 -0700)
committerepriestley <git@epriestley.com>
Tue, 26 Jun 2012 18:00:26 +0000 (11:00 -0700)
commit5b1a00eab1f5fb9a05c70db19fdb67c1ad2cf5af
tree8438987d0126b0a807a87532787db19ce3356505
parent69246b282dcc3ee2c0c9e1794405aa6e217a124c
Add various flags to the HgProxy daemons

Summary:
  - Add flags to exit after an idle time or client count.
  - Add flags to control daemonization.
  - Add flags to control output.
  - Add flags to skip the "hello" frame of the protocol.
  - Make the client launch a server if one does not exist.

The one-time overhead to launch a server and run a command through it looks to be ~130% of the overhead to run the command directly with "hg", so even if we never run a second command we're not paying too much.

The incremental overhead to run subsequent command appears to be less than 3% of the overhead to run the command directly with "hg" (and maybe less than 1%, I'm not sure how long the computation part of a command like 'hg log' "actually" takes).

The overhead to launch a PHP client, connect to an existing server, run a command, and then print it and exit is roughly 50% of the overhead to run the command directly with "hg". So theoretically a user can achieve an amortized 2x performance increase for all 'hg' commands by aliasing 'hg' to the PHP client in their shell.

Test Plan:
  - Ran servers with idle and client count limits, let them idle and/or hit their connection limits, saw them exit.
  - Ran foreground and background servers.
  - Ran a daemon server with redirected stdout/stderr. Verified logs appeared.
  - Ran with --quiet.
  - Ran clients and servers with and without --skip-hello, things work if they agree and break if they disagree. The throughput gain on this is fairly small (maybe 5%?) but it seems simple enough to keep for the moment.
  - Ran serverless clients and verified that servers launched the first time, were available subsequently, and relaunched after 15 seconds idle.

Reviewers: csilvers, vrana, btrahan

Reviewed By: csilvers

CC: aran
Differential Revision: https://secure.phabricator.com/D2680
scripts/hgdaemon/hgdaemon_client.php
scripts/hgdaemon/hgdaemon_server.php
src/hgdaemon/ArcanistHgProxyClient.php
src/hgdaemon/ArcanistHgProxyServer.php