Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / doc / admin / logs-table-management.html.textile.liquid
1 ---
2 layout: default
3 navsection: admin
4 title: "Logs table management"
5 ...
6
7 {% comment %}
8 Copyright (C) The Arvados Authors. All rights reserved.
9
10 SPDX-License-Identifier: CC-BY-SA-3.0
11 {% endcomment %}
12
13 This page aims to provide insight about managing the ever growing API Server's logs table.
14
15 h3. Logs table purpose & behavior
16
17 This database table currently serves three purposes:
18 * It's an audit log, permitting admins and users to look up the time and details of past changes to Arvados objects via @arvados.v1.logs.*@ endpoints.
19 * It's a mechanism for passing cache-invalidation events, used by websocket servers, the Python SDK "events" library, and @arvados-cwl-runner@ to detect when an object has changed.
20 * It's a staging area for stdout/stderr text coming from users' containers, permitting users to see what their containers are doing while they are still running (i.e., before those text files are written to Keep).
21
22 As a result, this table grows indefinitely, even on sites where policy does not require an audit log; making backups, migrations, and upgrades unnecessarily slow and painful.
23
24 h3. Configuration
25
26 To solve the problem mentioned above, the @AuditLogs@ section of @config.yml@ offers several options to limit the amount of log information stored on the table:
27
28 <pre>
29     AuditLogs:
30       # Time to keep audit logs. (An audit log is a row added
31       # to the "logs" table in the PostgreSQL database each time an
32       # Arvados object is created, modified, or deleted.)
33       #
34       # Currently, websocket event notifications rely on audit logs, so
35       # this should not be set lower than 5 minutes.
36       MaxAge: 336h
37
38       # Maximum number of log rows to delete in a single SQL transaction,
39       # to prevent surprises and avoid bad database behavior
40       # (especially the first time the cleanup job runs on an existing
41       # cluster with a huge backlog) a maximum number of rows to
42       # delete in a single transaction.
43       #
44       # If MaxDeleteBatch is 0, log entries will never be
45       # deleted by Arvados. Cleanup can be done by an external process
46       # without affecting any Arvados system processes, as long as very
47       # recent (<5 minutes old) logs are not deleted.
48       #
49       # 100000 is a reasonable batch size for most sites.
50       MaxDeleteBatch: 0
51
52       # Attributes to suppress in events and audit logs.  Notably,
53       # specifying {"manifest_text": {}} here typically makes the database
54       # smaller and faster.
55       #
56       # Warning: Using any non-empty value here can have undesirable side
57       # effects for any client or component that relies on event logs.
58       # Use at your own risk.
59       UnloggedAttributes: {}
60 </pre>
61
62
63 h3. Additional consideration
64
65 Depending on the local installation's audit requirements, the cluster admins should plan for an external backup procedure before enabling this feature, as this information is not replicated anywhere else.