NagiosEnterprises / nsca

NSCA Passive Check Daemon
GNU General Public License v2.0
42 stars 24 forks source link

nsca on FreeBSD delays every request #30

Closed stromnet closed 4 years ago

stromnet commented 6 years ago

Running nsca 2.9.2 on FreeBSD 10.3, with send_nsca 2.9.2 from another FreeBSD machine.

Daemon: /usr/local/sbin/nsca --single -c /usr/local/etc/nagios/nsca.cfg

Config:

log_facility=daemon
pid_file=/var/run/nsca.pid
server_port=5667
nsca_user=nagios
nsca_group=nagios
debug=0
command_file=/var/spool/nagios/rw/nagios.cmd
alternate_dump_file=/var/spool/nagios/rw/nsca.dump
aggregate_writes=0
append_to_file=0
max_packet_age=30
password=secret
decryption_method=8

For some reason, nsca seems to stall a few hundred ms to a second or similar before sending initial response, making the send_nsca process taking almost a second:

$ time send_nsca ....
1 data packet(s) sent to host successfully.
0.000u 0.003s 0:00.64 0.0%      0+0k 0+0io 0pf+0w

(0.6s here, typically between 0.15 and 1.05s) The issue is, that if I attach truss to the nsca process, it works without any delays at all, the nsca process takes about 0.02s all the time! So it's a bit hard to say what's going on..

Any ideas what to look further at?

stromnet commented 6 years ago

Example tcpdump of 1.00s session (client side measurement):

22:30:17.925362 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [S], seq 2726503834, win 65535, options [mss 1352,nop,wscale 6,sackOK,TS val 3771690726 ecr 0], length 0
22:30:17.925400 IP 172.28.10.4.5667 > 172.28.1.2.51600: Flags [S.], seq 755940715, ack 2726503835, win 65535, options [mss 1352,nop,wscale 6,sackOK,TS val 2224069728 ecr 3771690726], length 0
22:30:17.936848 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [.], ack 1, win 1025, options [nop,nop,TS val 3771690738 ecr 2224069728], length 0
22:30:18.918089 IP 172.28.10.4.5667 > 172.28.1.2.51600: Flags [P.], seq 1:133, ack 1, win 1025, options [nop,nop,TS val 2224070721 ecr 3771690738], length 132
22:30:18.930563 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [.], seq 1:1341, ack 133, win 1025, options [nop,nop,TS val 3771691731 ecr 2224070721], length 1340
22:30:18.930686 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [.], seq 1341:2681, ack 133, win 1025, options [nop,nop,TS val 3771691731 ecr 2224070721], length 1340
22:30:18.930698 IP 172.28.10.4.5667 > 172.28.1.2.51600: Flags [.], ack 2681, win 1005, options [nop,nop,TS val 2224070734 ecr 3771691731], length 0
22:30:18.930820 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [.], seq 2681:4021, ack 133, win 1025, options [nop,nop,TS val 3771691731 ecr 2224070721], length 1340
22:30:18.930842 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [P.], seq 4021:4305, ack 133, win 1025, options [nop,nop,TS val 3771691731 ecr 2224070721], length 284
22:30:18.930854 IP 172.28.10.4.5667 > 172.28.1.2.51600: Flags [.], ack 4305, win 979, options [nop,nop,TS val 2224070734 ecr 3771691731], length 0
22:30:18.930871 IP 172.28.1.2.51600 > 172.28.10.4.5667: Flags [F.], seq 4305, ack 133, win 1025, options [nop,nop,TS val 3771691731 ecr 2224070721], length 0
22:30:18.930880 IP 172.28.10.4.5667 > 172.28.1.2.51600: Flags [.], ack 4306, win 979, options [nop,nop,TS val 2224070734 ecr 3771691731], length 0

172.28.10.4 is the server running the nsca daemon

sawolf commented 4 years ago

Hi @stromnet,

I know it's been awhile since you posted this, but I took a look at this and haven't been able to reproduce this issue so far (though I've only tried with FreeBSD 12.1). Is this issue still affecting you?

stromnet commented 4 years ago

Wow, yeah that was a while ago.. :) Not sure if it is still broken, I ended up using https://github.com/NagiosEnterprises/nrdp instead. My nsca infrastructure is down nowadays so cannot help with testing anymore unfortunately.

sawolf commented 4 years ago

Thanks for the response!

If that's the case, I'm going to close this issue. I haven't heard of anyone else reporting this issue, so hopefully it was just an problem with the environment's configuration.