Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/configuration/managing_daemons.diviner
@title Managing Daemons with phd | @title Managing Daemons with phd | ||||
@group config | @group config | ||||
Explains Phabricator daemons and the daemon control program `phd`. | Explains Phorge daemons and the daemon control program `phd`. | ||||
= Overview = | = Overview = | ||||
Phabricator uses daemons (background processing scripts) to handle a number of | Phorge uses daemons (background processing scripts) to handle a number of | ||||
tasks: | tasks: | ||||
- tracking repositories, discovering new commits, and importing and parsing | - tracking repositories, discovering new commits, and importing and parsing | ||||
commits; | commits; | ||||
- sending email; and | - sending email; and | ||||
- collecting garbage, like old logs and caches. | - collecting garbage, like old logs and caches. | ||||
Daemons are started and stopped with **phd** (the **Ph**abricator **D**aemon | Daemons are started and stopped with **phd** (the **Ph**abricator **D**aemon | ||||
launcher). Daemons can be monitored via a web console. | launcher). Daemons can be monitored via a web console. | ||||
You do not need to run daemons for most parts of Phabricator to work, but some | You do not need to run daemons for most parts of Phorge to work, but some | ||||
features (principally, repository tracking with Diffusion) require them and | features (principally, repository tracking with Diffusion) require them and | ||||
several features will benefit in performance or stability if you configure | several features will benefit in performance or stability if you configure | ||||
daemons. | daemons. | ||||
= phd = | = phd = | ||||
**phd** is a command-line script (located at `phabricator/bin/phd`). To get | **phd** is a command-line script (located at `phorge/bin/phd`). To get | ||||
a list of commands, run `phd help`: | a list of commands, run `phd help`: | ||||
phabricator/ $ ./bin/phd help | phorge/ $ ./bin/phd help | ||||
NAME | NAME | ||||
phd - phabricator daemon launcher | phd - phorge daemon launcher | ||||
... | ... | ||||
Generally, you will use: | Generally, you will use: | ||||
- **phd start** to launch all daemons; | - **phd start** to launch all daemons; | ||||
- **phd restart** to restart all daemons; | - **phd restart** to restart all daemons; | ||||
- **phd status** to get a list of running daemons; and | - **phd status** to get a list of running daemons; and | ||||
- **phd stop** to stop all daemons. | - **phd stop** to stop all daemons. | ||||
If you want finer-grained control, you can use: | If you want finer-grained control, you can use: | ||||
- **phd launch** to launch individual daemons; and | - **phd launch** to launch individual daemons; and | ||||
- **phd debug** to debug problems with daemons. | - **phd debug** to debug problems with daemons. | ||||
NOTE: When you upgrade Phabricator or change configuration, you should restart | NOTE: When you upgrade Phorge or change configuration, you should restart | ||||
the daemons by running `phd restart`. | the daemons by running `phd restart`. | ||||
= Daemon Console = | = Daemon Console = | ||||
You can view status and debugging information for daemons in the Daemon Console | You can view status and debugging information for daemons in the Daemon Console | ||||
via the web interface. Go to `/daemon/` in your install or click | via the web interface. Go to `/daemon/` in your install or click | ||||
**Daemon Console** from "More Stuff". | **Daemon Console** from "More Stuff". | ||||
Show All 21 Lines | |||||
= Debugging and Tuning = | = Debugging and Tuning = | ||||
In most cases, **phd start** handles launching all the daemons you need. | In most cases, **phd start** handles launching all the daemons you need. | ||||
However, you may want to use more granular daemon controls to debug daemons, | However, you may want to use more granular daemon controls to debug daemons, | ||||
launch custom daemons, or launch special daemons like the IRC bot. | launch custom daemons, or launch special daemons like the IRC bot. | ||||
To debug a daemon, use `phd debug`: | To debug a daemon, use `phd debug`: | ||||
phabricator/bin/ $ ./phd debug <daemon> | phorge/bin/ $ ./phd debug <daemon> | ||||
You can pass arguments like this (normal arguments are passed to the daemon | You can pass arguments like this (normal arguments are passed to the daemon | ||||
control mechanism, not to the daemon itself): | control mechanism, not to the daemon itself): | ||||
phabricator/bin/ $ ./phd debug <daemon> -- --flavor apple | phorge/bin/ $ ./phd debug <daemon> -- --flavor apple | ||||
In debug mode, daemons do not daemonize, and they print additional debugging | In debug mode, daemons do not daemonize, and they print additional debugging | ||||
output to the console. This should make it easier to debug problems. You can | output to the console. This should make it easier to debug problems. You can | ||||
terminate the daemon with `^C`. | terminate the daemon with `^C`. | ||||
To launch a nonstandard daemon, use `phd launch`: | To launch a nonstandard daemon, use `phd launch`: | ||||
phabricator/bin/ $ ./phd launch <daemon> | phorge/bin/ $ ./phd launch <daemon> | ||||
This daemon will daemonize and run normally. | This daemon will daemonize and run normally. | ||||
== General Tips == | == General Tips == | ||||
- You can set the maximum number of taskmasters that will run at once | - You can set the maximum number of taskmasters that will run at once | ||||
by adjusting `phd.taskmasters`. If you have a task backlog, try increasing | by adjusting `phd.taskmasters`. If you have a task backlog, try increasing | ||||
it. | it. | ||||
- When you `phd launch` or `phd debug` a daemon, you can type any unique | - When you `phd launch` or `phd debug` a daemon, you can type any unique | ||||
substring of its name, so `phd launch pull` will work correctly. | substring of its name, so `phd launch pull` will work correctly. | ||||
- `phd stop` and `phd restart` stop **all** of the daemons on the machine, not | - `phd stop` and `phd restart` stop **all** of the daemons on the machine, not | ||||
just those started with `phd start`. If you're writing a restart script, | just those started with `phd start`. If you're writing a restart script, | ||||
have it launch any custom daemons explicitly after `phd restart`. | have it launch any custom daemons explicitly after `phd restart`. | ||||
- You can write your own daemons and manage them with `phd` by extending | - You can write your own daemons and manage them with `phd` by extending | ||||
@{class:PhabricatorDaemon}. See @{article@phabcontrib:Adding New Classes}. | @{class:PhabricatorDaemon}. See @{article@contrib:Adding New Classes}. | ||||
- See @{article:Diffusion User Guide} for details about tuning the repository | - See @{article:Diffusion User Guide} for details about tuning the repository | ||||
daemon. | daemon. | ||||
Multiple Hosts | Multiple Hosts | ||||
============== | ============== | ||||
For information about running daemons on multiple hosts, see | For information about running daemons on multiple hosts, see | ||||
@{article:Cluster: Daemons}. | @{article:Cluster: Daemons}. | ||||
Next Steps | Next Steps | ||||
========== | ========== | ||||
Continue by: | Continue by: | ||||
- learning about the repository daemon with @{article:Diffusion User Guide}; | - learning about the repository daemon with @{article:Diffusion User Guide}; | ||||
or | or | ||||
- writing your own daemons with @{article@phabcontrib:Adding New Classes}. | - writing your own daemons with @{article@contrib:Adding New Classes}. |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0