![$AddUnixListenSocket을 사용하면 rsyslog가 원격으로 데이터를 보내는 속도가 느려지나요?](https://linux55.com/image/75623/%24AddUnixListenSocket%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%98%EB%A9%B4%20rsyslog%EA%B0%80%20%EC%9B%90%EA%B2%A9%EC%9C%BC%EB%A1%9C%20%EB%8D%B0%EC%9D%B4%ED%84%B0%EB%A5%BC%20%EB%B3%B4%EB%82%B4%EB%8A%94%20%EC%86%8D%EB%8F%84%EA%B0%80%20%EB%8A%90%EB%A0%A4%EC%A7%80%EB%82%98%EC%9A%94%3F.png)
rsyslog를 통해 원격 서버에 쿼리를 기록하는 바쁜 DNS 서버를 실행하고 있습니다.
우리가 처리하고 있는 트래픽 양으로 인해 rsyslog.conf의 속도 제한을 높여야 했습니다. 서버는 초당 최대 약 1.2K DNS 요청을 처리합니다. 이는 원격 로거로 나가는 트래픽이 약 2Mbps임을 의미합니다.
그러나 $AddUnixListenSocket /var/named/chroot/dev/log
rsyslog 지시어를 사용하면 원격 서버로 전송되는 데이터가 급격히 감소하는 것을 볼 수 있습니다. 이 지시문이 없으면 rsyslog가 다시 시작된 후 로깅이 중지되고 BIND를 다시 시작해야 한다는 점을 제외하면 모든 것이 정상입니다.
$AddUnixListenSocket
추가하면 rsyslog의 속도 제한 증가가 "중단"되는 것 같습니다 . 여기서 무슨 일이 일어나고 있는 걸까요?
소프트웨어 버전: - CentOS 6.7 x86_64 - rsyslog-5.8.10-10.el6_6.x86_64 - bind-9.8.2-0.37.rc1.el6_7.2.x86_64
내 거 /etc/rsyslog.conf
:
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command)
$SystemLogRateLimitInterval 10
$SystemLogRateLimitBurst 15000
$ModLoad imklog # provides kernel logging support (previously done by rklogd)
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
$IncludeConfig /etc/rsyslog.d/*.conf
*.info;mail.none;authpriv.none;cron.none /var/log/messages
authpriv.* /var/log/secure
mail.* -/var/log/maillog
cron.* /var/log/cron
*.emerg *
uucp,news.crit /var/log/spooler
local7.* /var/log/boot.log
그리고 /etc/rsyslog.d/fwd.conf
:
# keep logging after rsyslog restart
$AddUnixListenSocket /var/named/chroot/dev/log
# ### begin forwarding rule ###
# The statement between the begin ... end define a SINGLE forwarding
# rule. They belong together, do NOT split them. If you create multiple
# forwarding rules, duplicate the whole block!
# Remote Logging (we use TCP for reliable delivery)
#
# An on-disk queue is created for this action. If the remote host is
# down, messages are spooled to disk and sent when it is up again.
$WorkDirectory /var/lib/rsyslog # where to place spool files
$ActionQueueFileName tso_fwd # unique name prefix for spool files
$ActionQueueMaxDiskSpace 1g # 1gb space limit (use as much as possible)
$ActionQueueMaxFileSize 100M # AF: limit open file descriptors
$ActionQueueSaveOnShutdown on # save messages to disk on shutdown
$ActionQueueType LinkedList # run asynchronously
$ActionQueueTimeoutEnqueue 0 # AF: discard when queue is full
$ActionResumeRetryCount -1 # infinite retries if host is down
# remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional
#*.* @@remote-host:514
local0.* @@1.1.1.1:514
& ~
# ### end of the forwarding rule ###
답변1
뭐, 속도 제한 설정은 정말 무시한 것 같군요.
추가했더니 $AddUnixListenSocket
입력이 imuxsock
자체 속도 제한 설정이 있는 모듈로 변경되었습니다.
상단은 /etc/rsyslog.d/fwd.conf
다음과 같습니다.
# raise logging limits
$IMUXSockRateLimitInterval 10
$IMUXSockRateLimitBurst 15000
# keep logging after rsyslog restart
$AddUnixListenSocket /var/named/chroot/dev/log
이로써 문제가 해결되었습니다.