Skip to content

Commit 3cd2b49

Browse files
committed
admin: networking: updating for style
Signed-off-by: Lynette Miles <lynette.miles@chronosphere.io>
1 parent 197ba68 commit 3cd2b49

File tree

2 files changed

+77
-50
lines changed

2 files changed

+77
-50
lines changed

administration/networking.md

Lines changed: 76 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,95 @@
11
# Networking
22

3-
[Fluent Bit](https://fluentbit.io) implements a unified networking interface that is exposed to components like plugins. This interface abstract all the complexity of general I/O and is fully configurable.
3+
[Fluent Bit](https://fluentbit.io) implements a unified networking interface that's
4+
exposed to components like plugins. This interface abstracts all the complexity of
5+
general I/O and is fully configurable.
46

5-
A common use case is when a component or plugin needs to connect to a service to send and receive data. Despite the operational mode sounds easy to deal with, there are many factors that can make things hard like unresponsive services, networking latency or any kind of connectivity error. The networking interface aims to abstract and simplify the network I/O handling, minimize risks and optimize performance.
7+
A common use case is when a component or plugin needs to connect to a service to send
8+
and receive data. There are many challenges to handle like unresponsive services,
9+
networking latency, or any kind of connectivity error. The networking interface aims
10+
to abstract and simplify the network I/O handling, minimize risks, and optimize
11+
performance.
612

7-
## Concepts
13+
## Networking concepts
814

9-
### TCP Connect Timeout
15+
Fluent Bit uses the following networking concepts:
1016

11-
Most of the time creating a new TCP connection to a remote server is straightforward and takes a few milliseconds. But there are cases where DNS resolving, slow network or incomplete TLS handshakes might create long delays, or incomplete connection statuses.
12-
13-
The `net.connect_timeout` allows to configure the maximum time to wait for a connection to be established, note that this value already considers the TLS handshake process.
17+
### TCP connect timeout
1418

15-
The `net.connect_timeout_log_error` indicates if an error should be logged in case of connect timeout. If disabled, the timeout is logged as debug level message instead.
19+
Most of the time creating a new TCP connection to a remote server is straightforward and takes a few milliseconds. But there are cases where DNS resolving, slow network or incomplete TLS handshakes might create long delays, or incomplete connection statuses.
1620

17-
### TCP Source Address
21+
`net.connect_timeout` lets you configure the maximum time to wait for a connection
22+
to be established. This value already considers the TLS handshake process.
1823

19-
On environments with multiple network interfaces, might be desired to choose which interface to use for our data that will flow through the network.
24+
`net.connect_timeout_log_error` indicates if an error should be logged in case of
25+
connect timeout. If disabled, the timeout is logged as a debug level message.
2026

21-
The `net.source_address` allows to specify which network address must be used for a TCP connection and data flow.
27+
### TCP source address
2228

23-
### Connection Keepalive
29+
On environments with multiple network interfaces, you can choose which
30+
interface to use for Fluent Bit data that will flow through the network.
2431

25-
TCP is a _connected oriented_ channel, to deliver and receive data from a remote end-point in most of cases we use a TCP connection. This TCP connection can be created and destroyed once is not longer needed, this approach has pros and cons, here we will refer to the opposite case: keep the connection open.
32+
Use `net.source_address` to specify which network address to use for a TCP connection
33+
and data flow.
2634

27-
The concept of `Connection Keepalive` refers to the ability of the client \(Fluent Bit on this case\) to keep the TCP connection open in a persistent way, that means that once the connection is created and used, instead of close it, it can be recycled. This feature offers many benefits in terms of performance since communication channels are always established before hand.
35+
### Connection keepalive
2836

29-
Any component that uses TCP channels like HTTP or [TLS](transport-security.md), can take advantage of this feature. For configuration purposes use the `net.keepalive` property.
37+
A connection keepalive refers to the ability of a client to keep the TCP connection
38+
open in a persistent way. This feature offers many benefits in terms
39+
of performance since communication channels are always established before hand.
3040

31-
### Connection Keepalive Idle Timeout
41+
Any component that uses TCP channels like HTTP or [TLS](transport-security.md), can
42+
take advantage of this feature. For configuration purposes use the `net.keepalive`
43+
property.
3244

33-
If a connection is keepalive enabled, there might be scenarios where the connection can be unused for long periods of time. Having an idle keepalive connection is not helpful and is recommendable to keep them alive if they are used.
45+
### Connection keepalive idle timeout
3446

35-
In order to control how long a keepalive connection can be idle, we expose the configuration property called `net.keepalive_idle_timeout`.
47+
If a connection is keepalive enabled, there might be scenarios where the connection
48+
can be unused for long periods of time. Unused connections can be removed. To control
49+
how long a keepalive connection can be idle, Fluent Bit uses a configuration property
50+
called `net.keepalive_idle_timeout`.
3651

3752
### DNS mode
3853

39-
If a transport layer protocol is specified, the plugin whose configuration section the `net.dns.mode` setting is specified on overrides the global `dns.mode` value and issues DNS requests using the specified protocol which can be either TCP or UDP
40-
41-
### Max Connections Per Worker
42-
43-
By default, Fluent Bit tries to deliver data as faster as possible and create TCP connections on-demand and in keepalive mode for performance reasons. In high-scalable environments, the user might want to control how many connections are done in parallel by setting a limit.
44-
45-
This can be done by the configuration property called `net.max_worker_connections` that can be used in the output plugins sections.
46-
This feature acts at the worker level, e.g., if you have 5 workers and `net.max_worker_connections` is set to 10, a max of 50 connections will be allowed.
47-
If the limit is reached, the output plugin will issue a retry.
48-
49-
50-
## Configuration Options
51-
52-
For plugins that rely on networking I/O, the following section describes the network configuration properties available and how they can be used to optimize performance or adjust to different configuration needs:
53-
54-
| Property | Description | Default |
55-
| :--- |:------------------------------------------------------------------------------------------------------------------------------------------|:--------------|
56-
| `net.connect_timeout` | Set maximum time expressed in seconds to wait for a TCP connection to be established, this include the TLS handshake time. | 10 |
57-
| `net.connect_timeout_log_error` | On connection timeout, specify if it should log an error. When disabled, the timeout is logged as a debug message. | true |
58-
| `net.dns.mode` | Select the primary DNS connection type (TCP or UDP). Can be set in the [SERVICE] section and overridden on a per plugin basis if desired. | |
59-
| `net.dns.prefer_ipv4` | Prioritize IPv4 DNS results when trying to establish a connection. | false |
60-
| `net.dns.resolver`| Select the primary DNS resolver type (LEGACY or ASYNC). | |
61-
| `net.keepalive` | Enable or disable connection keepalive support. Accepts a boolean value: on / off. | on |
62-
| `net.keepalive_idle_timeout` | Set maximum time expressed in seconds for an idle keepalive connection. | 30 |
63-
| `net.keepalive_max_recycle` | Set maximum number of times a keepalive connection can be used before it is retired. | 2000 |
64-
| `net.max_worker_connections` | Set maximum number of TCP connections that can be established per worker. | 0 (unlimited) |
65-
| `net.source_address` | Specify network address to bind for data traffic. | |
54+
The global `dns.mode` value issues DNS requests using the specified protocol, either
55+
TCP or UDP. If a transport layer protocol is specified, plugins that configure the
56+
`net.dns.mode` setting override the global setting.
57+
58+
### Maximum connections per worker
59+
60+
Fluent Bit tries to deliver data as faster as possible and create TCP connections
61+
on-demand and in keepalive mode for performance reasons. In highly scalable
62+
environments, you might want to control how many connections are done in
63+
parallel by setting a limit.
64+
65+
Use the property called `net.max_worker_connections` property in the output plugins
66+
sections. This property acts at the worker level. For example, if you have 5 workers
67+
and `net.max_worker_connections` is set to 10, a maximum of 50 connections will be
68+
allowed. If the limit is reached, the output plugin will issue a retry.
69+
70+
## Configuration options
71+
72+
The following table describes the network configuration properties available and
73+
their usage in optimizing performance or adjusting configuration needs for plugins
74+
that rely on networking I/O:
75+
76+
| Property | Description | Default |
77+
| :------- |:------------|:--------|
78+
| `net.connect_timeout` | Set maximum time expressed in seconds to wait for a TCP connection to be established, this include the TLS handshake time. | `10` |
79+
| `net.connect_timeout_log_error` | On connection timeout, specify if it should log an error. When disabled, the timeout is logged as a debug message. | `true` |
80+
| `net.dns.mode` | Select the primary DNS connection type (TCP or UDP). Can be set in the [SERVICE] section and overridden on a per plugin basis if desired. | _none_ |
81+
| `net.dns.prefer_ipv4` | Prioritize IPv4 DNS results when trying to establish a connection. | `false` |
82+
| `net.dns.resolver`| Select the primary DNS resolver type (`LEGACY` or `ASYNC`). | _none_ |
83+
| `net.keepalive` | Enable or disable connection keepalive support. Accepts a Boolean value: `on` or `off`.  | `on` |
84+
| `net.keepalive_idle_timeout` | Set maximum time expressed in seconds for an idle keepalive connection. | `30` |
85+
| `net.keepalive_max_recycle` | Set maximum number of times a keepalive connection can be used before it's retired. | `2000` |
86+
| `net.max_worker_connections` | Set maximum number of TCP connections that can be established per worker. | `0` (unlimited) |
87+
| `net.source_address` | Specify network address to bind for data traffic. | _none_ |
6688

6789
## Example
6890

69-
As an example, we will send 5 random messages through a TCP output connection, in the remote side we will use `nc` \(netcat\) utility to see the data.
91+
This example sends 5 random messages through a TCP output connection. The remote
92+
side uses the `nc` (netcat) utility to see the data.
7093

7194
Put the following configuration snippet in a file called `fluent-bit.conf`:
7295

@@ -96,10 +119,11 @@ Put the following configuration snippet in a file called `fluent-bit.conf`:
96119
In another terminal, start `nc` and make it listen for messages on TCP port 9090:
97120

98121
```text
99-
$ nc -l 9090
122+
nc -l 9090
100123
```
101124

102-
Now start Fluent Bit with the configuration file written above and you will see the data flowing to netcat:
125+
Now start Fluent Bit with the configuration file written previously and you will see
126+
the data flowing to netcat:
103127

104128
```text
105129
$ nc -l 9090
@@ -110,6 +134,8 @@ $ nc -l 9090
110134
{"date":1587769736.572277,"rand_value":527581343064950185}
111135
```
112136

113-
If the `net.keepalive` option is not enabled, Fluent Bit will close the TCP connection and netcat will quit, here we can see how the keepalive connection works.
137+
If the `net.keepalive` option isn't enabled, Fluent Bit will close the TCP connection
138+
and netcat will quit.
114139

115-
After the 5 records arrive, the connection will keep idle and after 10 seconds it will be closed due to `net.keepalive_idle_timeout`.
140+
After the 5 records arrive, the connection will idle. After 10 seconds it will be
141+
closed due to `net.keepalive_idle_timeout`.

vale-styles/FluentBit/Spelling-exceptions.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ minikube
9191
MTTx
9292
namespace
9393
namespaces
94+
netcat
9495
Nginx
9596
OAuth
9697
Okta

0 commit comments

Comments
 (0)