Skip to content

Commit 623cea7

Browse files
docs: add "Architecture and Load Balancers" (#2574)
1 parent 334f2f0 commit 623cea7

File tree

10 files changed

+627
-128
lines changed

10 files changed

+627
-128
lines changed

docs/architecture.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

docs/architecture/index.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Architectural Considerations
2+
3+
Building a syslog ingestion architecture is complex and requires careful planning. The syslog protocol prioritizes speed and efficiency, often at the expense of resiliency and reliability. Due to these trade-offs, traditional scaling methods may not be directly applicable to syslog.
4+
5+
This document outlines recommended architectural solutions, along with alternative or unsupported methods that some users have found viable.
6+
7+
## Edge vs. centralized collection
8+
9+
While TCP and TLS are supported, UDP remains the dominant protocol for syslog transport in many data centers. Since syslog is a "send and forget" protocol, it performs poorly when routed through complex network infrastructures, including front-end load balancers and WAN.
10+
11+
The most reliable way to gather syslog traffic is through edge collection rather than centralized collection. When the syslog server is centrally located, UDP and stateless TCP traffic cannot adapt, leading to potential data loss.
12+
13+
Deploy SC4S instances in the same VLAN as the source devices.
14+
15+
## Avoid load balancing for syslog
16+
17+
Scale vertically by fine-tuning a single, robust server. Tools and methods for enhancing performance on your SC4S server are documented in:
18+
19+
1. [Fine-tune for TCP](tcp-optimization.md)
20+
2. [Fine-tune for UDP](udp-optimization.md)
21+
22+
Avoid co-locating syslog-ng servers for horizontal scaling with load balancers. Load balancing challenges for horizontal scaling are described in the [Load Balancer's Overview](lb/index.md) section.
23+
24+
## High Availability (HA) considerations
25+
26+
Syslog is prone to data loss and can only achieve "mostly available" data collection.
27+
28+
### HA without load balancers
29+
30+
Load balancing does not work well with syslog’s stateless, unacknowledged traffic. Preserve more data by using simpler designs, such as vMotioned VMs.
31+
32+
The best deployment model for high availability is a [Microk8s](https://microk8s.io/) setup with MetalLB in BGP mode. This implements load balancing through destination network translation, providing better HA results.
33+
34+
## UDP vs. TCP
35+
36+
Syslog often uses UDP for log forwarding due to its low overhead and simplicity. UDP eliminates the need for network session establishment, which reduces network strain and avoids complex verification processes.
37+
38+
### Drawbacks of TCP
39+
40+
TCP uses acknowledgement signals (ACKS) to mitigate data loss. Issues may still arise, including:
41+
42+
- Events may be lost during TCP session establishment.
43+
- Slow acknowledgment signals may lead to buffer overflows.
44+
- Lost acknowledgments may cause closed connections.
45+
- Data may be lost when the server restarts.
46+
47+
### When to use UDP vs. TCP
48+
49+
SC4S supports syslog ingestion via UDP, TCP/TLS, or a combination of both.
50+
51+
You can use UDP by default, but TCP is often preferable, for example for larger syslog events that exceed UDP packet limits, such as those from Web Proxy, DLP, or IDS sources.
52+
53+
The following resources can help you determine the best protocol for your setup:
54+
55+
1. [Run performance tests for TCP](performance-tests.md#check-your-tcp-performance)
56+
2. [Run performance tests for UDP](performance-tests.md#check-your-udp-performance)

docs/architecture/lb/index.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Load Balancers Are Not a Best Practice for SC4S
2+
3+
The following issues may arise from load balancing syslog traffic:
4+
5+
- Load balancing for scale can lead to increased data loss due to normal device operations and buffer overflows.
6+
- Front-side load balancing often results in uneven upstream data distribution.
7+
- The default behavior of many load balancers is to overwrite the client's source IP with their own. Preserving the real source IP requires additional configuration.
8+
9+
### Best practices when using load balancers:
10+
- Preserve the actual source IP of the sending device.
11+
- Avoid using load balancers without High Availability (HA) mode.
12+
- TCP/TLS load balancers may not account for the load on individual connections and might favor one instance over others. Ensure all members in a resource pool are vertically scaled to handle the full workload.
13+
14+
For **TCP**, you can use either a DNAT configuration or SNAT with the "PROXY" protocol enabled by setting `SC4S_SOURCE_PROXYCONNECT=yes`.
15+
For **UDP**, traffic can only pass through a load balancer using DNAT.
16+
17+
This section of the documentation discusses various load balancing solutions and example configurations, as well as known issues.
18+
19+
Please note that load balancing syslog traffic in front of SC4S is not supported by Splunk, and additional support from the load balancer vendor may be required.

0 commit comments

Comments
 (0)