Changeset View
Changeset View
Standalone View
Standalone View
src/docs/user/configuration/managing_garbage.diviner
@title Managing Garbage Collection | @title Managing Garbage Collection | ||||
@group config | @group config | ||||
Understanding and configuring garbage collection. | Understanding and configuring garbage collection. | ||||
Overview | Overview | ||||
======== | ======== | ||||
Phabricator generates various logs and caches during normal operation. Some of | Phorge generates various logs and caches during normal operation. Some of | ||||
these logs and caches are usually of very little use after some time has | these logs and caches are usually of very little use after some time has | ||||
passed, so they are deleted automatically (often after a month or two) in a | passed, so they are deleted automatically (often after a month or two) in a | ||||
process called "garbage collection". | process called "garbage collection". | ||||
Garbage collection is performed automatically by the daemons. You can review | Garbage collection is performed automatically by the daemons. You can review | ||||
all of the installed garbage collectors by browsing to {nav Config > Garbage | all of the installed garbage collectors by browsing to {nav Config > Garbage | ||||
Collectors}. | Collectors}. | ||||
Show All 12 Lines | |||||
some logs for a longer period of time, perhaps for auditing or analytic | some logs for a longer period of time, perhaps for auditing or analytic | ||||
purposes. | purposes. | ||||
You can review the current retention policies in | You can review the current retention policies in | ||||
{nav Config > Garbage Collectors}. To change a policy, use | {nav Config > Garbage Collectors}. To change a policy, use | ||||
`bin/garbage set-policy` to select a new policy: | `bin/garbage set-policy` to select a new policy: | ||||
``` | ``` | ||||
phabricator/ $ ./bin/garbage set-policy --collector cache.markup --days 7 | phorge/ $ ./bin/garbage set-policy --collector cache.markup --days 7 | ||||
``` | ``` | ||||
You can use `--days` to select how long data is retained for. You can also use | You can use `--days` to select how long data is retained for. You can also use | ||||
`--indefinite` to set an indefinite retention policy. This will stop the | `--indefinite` to set an indefinite retention policy. This will stop the | ||||
garbage collector from cleaning up any data. Finally, you can use `--default` | garbage collector from cleaning up any data. Finally, you can use `--default` | ||||
to restore the default policy. | to restore the default policy. | ||||
Your changes should be reflected in the web UI immediately, and will take | Your changes should be reflected in the web UI immediately, and will take | ||||
effect in the actual collector **the next time the daemons are restarted**. | effect in the actual collector **the next time the daemons are restarted**. | ||||
Troubleshooting | Troubleshooting | ||||
=============== | =============== | ||||
You can manually run a collector with `bin/garbage collect`. | You can manually run a collector with `bin/garbage collect`. | ||||
``` | ``` | ||||
phabricator/ $ ./bin/garbage collect --collector cache.general | phorge/ $ ./bin/garbage collect --collector cache.general | ||||
``` | ``` | ||||
By using the `--trace` flag, you can inspect the operation of the collector | By using the `--trace` flag, you can inspect the operation of the collector | ||||
in detail. | in detail. | ||||
Next Steps | Next Steps | ||||
========== | ========== | ||||
Continue by: | Continue by: | ||||
- exploring other daemon topics with @{article:Managing Daemons with phd}. | - exploring other daemon topics with @{article:Managing Daemons with phd}. |
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