brutella / hc

hc is a lightweight framework to develop HomeKit accessories in Go.
Apache License 2.0
1.74k stars 189 forks source link

High io load (read) #190

Open yangm97 opened 3 years ago

yangm97 commented 3 years ago

Running hc v1.2.1.

This is probably happening in response to high memory usage on the host by other processes. My code doesn't touch the filesystem, it only communicates with another service over websocket.

I let iotop run for a while in (a)ccumulator mode and got those figures: image

# lsof -p 13867
COMMAND    PID USER   FD      TYPE DEVICE SIZE/OFF   NODE NAME
hkbridge 13867 root  cwd       DIR  179,1     4096 152940 /data
hkbridge 13867 root  rtd       DIR   0,51     4096 129335 /
hkbridge 13867 root  txt       REG   0,51 10094701 152913 /hkbridge
hkbridge 13867 root  mem       REG  179,1          152913 /hkbridge (stat: No such file or directory)
hkbridge 13867 root    0u      CHR    1,3      0t0 745146 /dev/null
hkbridge 13867 root    1w     FIFO   0,11      0t0 745094 pipe
hkbridge 13867 root    2w     FIFO   0,11      0t0 745095 pipe
hkbridge 13867 root    3u     IPv4 745170      0t0    UDP *:mdns
hkbridge 13867 root    4u  a_inode   0,12        0   8724 [eventpoll]
hkbridge 13867 root    5u     IPv6 745172      0t0    UDP *:mdns
hkbridge 13867 root    7u     IPv4 744386      0t0    UDP *:mdns
hkbridge 13867 root    8u     IPv6 746880      0t0    TCP *:63531 (LISTEN)
hkbridge 13867 root   10u     IPv6 744388      0t0    UDP *:mdns
hkbridge 13867 root   14u     IPv4 868978      0t0    TCP localhost:35482->localhost:3000 (ESTABLISHED)
hkbridge 13867 root   15u     IPv6 870928      0t0    TCP hubot:63531->192.168.18.30:62188 (ESTABLISHED)

Unfortunately the machine hang before I could inspect further.