
TLDR;
syslog 메시지를 전달할 때 처리량이 크게 감소합니다.rsyslog32개의 코어와 128Gi RAM이 있는 Redhat 서버에서 UDP syslog 대신 TCP를 사용하는 원격 서버로omfwd행동.
인바운드 메시지 볼륨을 유지하면서 메시지 전달에 TCP를 어떻게 사용할 수 있습니까?
참고 1: pps = 초당 패킷
참고 2: Rx와 Tx 통계의 차이점에 유의하세요.
UDP를 사용하여 수신 메시지를 전달하는 경우:
[~]$ ./check_network_stats.bash eth0
Rx 10088 pps Tx 10092 pps |--| Rx 7 Mbps Tx 7 Mbps
Rx 11858 pps Tx 11857 pps |--| Rx 8 Mbps Tx 8 Mbps
Rx 11503 pps Tx 11502 pps |--| Rx 8 Mbps Tx 8 Mbps
Rx 11423 pps Tx 11321 pps |--| Rx 8 Mbps Tx 8 Mbps
TCP를 사용하여 수신 메시지를 전달하는 경우:
[~]$ source check_network_stats.bash eth0
Rx 10318 pps Tx 87 pps |--| Rx 7 Mbps Tx 0 Mbps
Rx 12150 pps Tx 162 pps |--| Rx 8 Mbps Tx 0 Mbps
Rx 9504 pps Tx 139 pps |--| Rx 7 Mbps Tx 0 Mbps
Rx 9774 pps Tx 67 pps |--| Rx 6 Mbps Tx 0 Mbps
Rx 12894 pps Tx 159 pps |--| Rx 9 Mbps Tx 0 Mbps
rsyslog.conf:
# rsyslog configuration file
#################
#### MODULES ####
#################
module(load="imjournal" StateFile="imjournal.state")
module(load="imklog") # reads kernel messages (the same are read from journald)
module(load="immark" interval="300") # provides --MARK-- message capability
module(load="imudp" threads="4" batchSize ="128") # Provides UDP syslog reception
module(load="imptcp" threads="10") # Provides TCP syslog reception
module(load="builtin:omfile" Template="RSYSLOG_TraditionalFileFormat") # Use default timestamp format
###############
#### RULES ####
###############
ruleset(name="sendToLogstash") {
action(type="omfwd"
name="action_ls"
Target="10.10.10.10"
Port="514"
Protocol="udp" # when this changed to TCP, throughput drops
queue.type="FixedArray"
)
}
###########################
#### LISTENERS ####
###########################
input(type="imudp" port="514" ruleset="sendToLogstash")
input(type="imptcp" port="514" ruleset="sendToLogstash")
###########################
#### GLOBAL DIRECTIVES ####
###########################
mark.* /var/log/messages
# Where to place auxiliary files
global(workDirectory="/var/lib/rsyslog")