Open jimklimov opened 6 years ago
If you still have the strace
output, or if you can grab this from /proc/PID/fd
, what is fd#6 connected to?
If it is the dev file, then maybe the code is not handling EOF correctly?
Those listed in readfds will be watched to see if characters become available for reading (more precisely, to see if a read will not block; in particular, a file descriptor is also ready on end-of-file), ...
I'm not sure why the PING
s are not getting flushed.
Some unspecified socket; the dev-file is fd#4:
# ls -la /proc/60?/fd/*
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/3 -> socket:[2029779593]
lr-x------ 1 root root 64 Jun 29 14:37 /proc/602/fd/4 -> /etc/nut/Eaton__UPS_9PX_snmp_pw.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/5 -> socket:[2029779623]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/6 -> socket:[2029812746]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/602/fd/7 -> socket:[2041957512]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/3 -> socket:[2029787142]
lr-x------ 1 root root 64 Jun 29 14:38 /proc/603/fd/4 -> /etc/nut/Eaton__UPS_9PX_netxml.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/5 -> socket:[2029787169]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/6 -> socket:[2029812750]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/603/fd/7 -> socket:[2041962657]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/3 -> socket:[2029779599]
lr-x------ 1 root root 64 Jun 29 14:37 /proc/604/fd/4 -> /etc/nut/Eaton__UPS_9PX_snmp_mge.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/5 -> socket:[2029779625]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/6 -> socket:[2029812748]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/604/fd/7 -> socket:[2041937804]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/3 -> socket:[2029782520]
lr-x------ 1 root root 64 Jun 29 14:37 /proc/605/fd/4 -> /etc/nut/Eaton__EPDU_MI_0U_(309W_32A_3P)18XC13_9XC19_combo_MI_38U-A__snmp-ups__2.7.4.1__01.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/5 -> socket:[2029782543]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/6 -> socket:[2029812756]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/605/fd/7 -> socket:[2041964523]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/3 -> socket:[2029786199]
lr-x------ 1 root root 64 Jun 29 14:37 /proc/606/fd/4 -> /etc/nut/Eaton__EPDU_MI_38U-A__snmp-ups__2.7.4__01.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/5 -> socket:[2029786228]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/6 -> socket:[2029812754]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/606/fd/7 -> socket:[2041964527]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/0 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/1 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/2 -> /dev/null
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/3 -> socket:[2029784179]
lr-x------ 1 root root 64 Jun 29 14:37 /proc/607/fd/4 -> /etc/nut/Eaton__EPDU_MI_0U_(309W_32A_3P)18XC13_9XC19__snmp-ups__2.7.4.1__01.dev
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/5 -> socket:[2029784200]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/6 -> socket:[2029812752]
lrwx------ 1 root root 64 Jun 29 14:37 /proc/607/fd/7 -> socket:[2041964592]
As another data point: despite all this, upsc DEVICENAME
passes well, quickly and producing some reasonably looking key: value
results.
We have a system that acts as a sort of NUT proxy, to alleviate actual power devices during testing, and to provide some virtual devices - both roles implemented by dummy-ups from 42ity fork of NUT (should be on par with github master). The system was restarted about a week ago, and today I've noticed that the dummy-ups drivers that serve "dev" files consume a lot of CPU (50-70% of a core each) despite the files ending with a
TIMER 60
line.Restarting the driver in debug mode did not help - it behaves as it should, reading the file and then quickly and quietly refreshing the state ("I'm not stale") with no load on the system.
While
strace
ing the driver with high load, which ran for a week now, I see it doing the following loop:(many screenfuls of this spit out quickly)
then a sleep:
followed by another burst like above
with occasional occurrences of
For the load,
top
says this: