Skip to content

Commit 5275330

Browse files
authored
Merge pull request #68228 from abrennan89/OBSDOCS-479-2
OBSDOCS-479: Add flow control / rate limit docs
2 parents 7a10fb2 + 8558c56 commit 5275330

File tree

11 files changed

+188
-1
lines changed

11 files changed

+188
-1
lines changed

_topic_maps/_topic_map.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2608,6 +2608,11 @@ Topics:
26082608
File: custom-logging-alerts
26092609
- Name: Troubleshooting logging alerts
26102610
File: troubleshooting-logging-alerts
2611+
- Name: Performance and reliability tuning
2612+
Dir: performance_reliability
2613+
Topics:
2614+
- Name: Flow control mechanisms
2615+
File: logging-flow-control-mechanisms
26112616
- Name: Troubleshooting Logging
26122617
Dir: troubleshooting
26132618
Distros: openshift-enterprise,openshift-origin

_topic_maps/_topic_map_osd.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,11 @@ Topics:
10961096
File: custom-logging-alerts
10971097
- Name: Troubleshooting logging alerts
10981098
File: troubleshooting-logging-alerts
1099+
- Name: Performance and reliability tuning
1100+
Dir: performance_reliability
1101+
Topics:
1102+
- Name: Flow control mechanisms
1103+
File: logging-flow-control-mechanisms
10991104
- Name: Troubleshooting Logging
11001105
Dir: troubleshooting
11011106
Topics:

_topic_maps/_topic_map_rosa.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,6 +1305,11 @@ Topics:
13051305
File: custom-logging-alerts
13061306
- Name: Troubleshooting logging alerts
13071307
File: troubleshooting-logging-alerts
1308+
- Name: Performance and reliability tuning
1309+
Dir: performance_reliability
1310+
Topics:
1311+
- Name: Flow control mechanisms
1312+
File: logging-flow-control-mechanisms
13081313
- Name: Troubleshooting Logging
13091314
Dir: troubleshooting
13101315
Topics:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../_attributes/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../images/
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
include::_attributes/common-attributes.adoc[]
3+
include::_attributes/attributes-openshift-dedicated.adoc[]
4+
[id="logging-flow-control-mechanisms"]
5+
= Flow control mechanisms
6+
:context: logging-flow-control-mechanisms
7+
8+
toc::[]
9+
10+
If logs are produced faster than they can be collected, it can be difficult to predict or control the volume of logs being sent to an output.
11+
Not being able to predict or control the volume of logs being sent to an output can result in logs being lost. If there is a system outage and log buffers are accumulated without user control, this can also cause long recovery times and high latency when the connection is restored.
12+
13+
As an administrator, you can limit logging rates by configuring flow control mechanisms for your {logging}.
14+
15+
[id="logging-configuring-flow-control-benefits"]
16+
== Benefits of flow control mechanisms
17+
18+
* The cost and volume of logging can be predicted more accurately in advance.
19+
* Noisy containers cannot produce unbounded log traffic that drowns out other containers.
20+
* Ignoring low-value logs reduces the load on the logging infrastructure.
21+
* High-value logs can be preferred over low-value logs by assigning higher rate limits.
22+
23+
[id="logging-configuring-flow-control-about-rate-limits"]
24+
== Configuring rate limits
25+
26+
Rate limits are configured per collector, which means that the maximum rate of log collection is the number of collector instances multiplied by the rate limit.
27+
28+
Because logs are collected from each node's file system, a collector is deployed on each cluster node. For example, in a 3-node cluster, with a maximum rate limit of 10 records per second per collector, the maximum rate of log collection is 30 records per second.
29+
30+
Because the exact byte size of a record as written to an output can vary due to transformations, different encodings, or other factors, rate limits are set in number of records instead of bytes.
31+
32+
You can configure rate limits in the `ClusterLogForwarder` custom resource (CR) in two ways:
33+
34+
Output rate limit:: Limit the rate of outbound logs to selected outputs, for example, to match the network or storage capacity of an output. The output rate limit controls the aggregated per-output rate.
35+
36+
Input rate limit:: Limit the per-container rate of log collection for selected containers.
37+
38+
include::modules/logging-set-output-rate-limit.adoc[leveloffset=+1]
39+
40+
[role="_additional-resources"]
41+
.Additional resources
42+
* xref:../../logging/log_collection_forwarding/logging-output-types.adoc#logging-output-types[Log output types]
43+
44+
include::modules/logging-set-input-rate-limit.adoc[leveloffset=+1]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../modules/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../snippets/

modules/logging-create-clf.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You need administrator permissions for the namespace where you create the `Clust
1919
.ClusterLogForwarder resource example
2020
[source,yaml]
2121
----
22-
apiVersion: "logging.openshift.io/v1"
22+
apiVersion: logging.openshift.io/v1
2323
kind: ClusterLogForwarder
2424
metadata:
2525
name: <log_forwarder_name> <1>
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * logging/performance_reliability/logging-flow-control-mechanisms.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="logging-set-input-rate-limit_{context}"]
7+
= Configuring log forwarder input rate limits
8+
9+
You can limit the rate of incoming logs that are collected by configuring the `ClusterLogForwarder` custom resource (CR). You can set input limits on a per-container or per-namespace basis.
10+
11+
.Prerequisites
12+
13+
* You have installed the {clo}.
14+
* You have administrator permissions.
15+
16+
.Procedure
17+
18+
. Add a `maxRecordsPerSecond` limit value to the `ClusterLogForwarder` CR for a specified input.
19+
+
20+
The following examples show how to configure input rate limits for different scenarios:
21+
+
22+
.Example `ClusterLogForwarder` CR that sets a per-container limit for containers with certain labels
23+
[source,yaml]
24+
----
25+
apiVersion: logging.openshift.io/v1
26+
kind: ClusterLogForwarder
27+
metadata:
28+
# ...
29+
spec:
30+
# ...
31+
inputs:
32+
- name: <input_name> <1>
33+
application:
34+
selector:
35+
matchLabels: { example: label } <2>
36+
limitPerContainer:
37+
maxRecordsPerSecond: 0 <3>
38+
# ...
39+
----
40+
<1> The input name.
41+
<2> A list of labels. If these labels match labels that are applied to a pod, the per-container limit specified in the `maxRecordsPerSecond` field is applied to those containers.
42+
<3> Configures the rate limit. Setting the `maxRecordsPerSecond` field to `0` means that no logs are collected for the container. Setting the `maxRecordsPerSecond` field to some other value means that a maximum of that number of records per second are collected for the container.
43+
+
44+
.Example `ClusterLogForwarder` CR that sets a per-container limit for containers in selected namespaces
45+
[source,yaml]
46+
----
47+
apiVersion: logging.openshift.io/v1
48+
kind: ClusterLogForwarder
49+
metadata:
50+
# ...
51+
spec:
52+
# ...
53+
inputs:
54+
- name: <input_name> <1>
55+
application:
56+
namespaces: [ example-ns-1, example-ns-2 ] <2>
57+
limitPerContainer:
58+
maxRecordsPerSecond: 10 <3>
59+
- name: <input_name>
60+
application:
61+
namespaces: [ test ]
62+
limitPerContainer:
63+
maxRecordsPerSecond: 1000
64+
# ...
65+
----
66+
<1> The input name.
67+
<2> A list of namespaces. The per-container limit specified in the `maxRecordsPerSecond` field is applied to all containers in the namespaces listed.
68+
<3> Configures the rate limit. Setting the `maxRecordsPerSecond` field to `10` means that a maximum of 10 records per second are collected for each container in the namespaces listed.
69+
70+
. Apply the `ClusterLogForwarder` CR:
71+
+
72+
.Example command
73+
[source,terminal]
74+
----
75+
$ oc apply -f <filename>.yaml
76+
----

0 commit comments

Comments
 (0)