You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a pretty rare incident but i have spent a few hours finding the root cause so i want to create an issue for it.
I have two Raspberry Pi:s with USB-connected AIS-receivers in a remote location with low to no AIS-traffic that services a SAR function in the area.
Both Kplex:es on both Rpi:s are experiencing "Too many open files" from time to time. If kplex is restarted, problem is solved.
From what i can find (with my limited network knowledge) the issue comes from marinetraffic.com (from now on MT) expects NMEA-packets every 10 seconds or less. If no data is received they send a TCP FIN to the client and asks to end the connection. This probably for performance reasons.
If traffic then IS being sent by the client after these 10 seconds, MT responds with a RST which probably is a more harsh way to tell kplex that the listening socket in the other end is closed. (The AIS-traffic in the example below is a keepalive script that injects an NMEA-sentence to kplex every minute)
What i think this gives, is a lot of open sockets(?) which over time reaches a limit where kplex is not allowed to create any more (1024 max)
Not sure if this is due to how MT handles the connection or if this is an issue with kplex or my installation specifically.
As for the issue for me, its looks to be handled by adjusting the rate of keepalivepackets below 10 seconds. I have also read about the keepalive function that has been added to kplex. Still the number of unclosed sockets is an issue that perhaps could happen to others.
Details:
Running version 1.4-55-ga7d726b (develop branch Aug 4, 2022)
This is a pretty rare incident but i have spent a few hours finding the root cause so i want to create an issue for it.
I have two Raspberry Pi:s with USB-connected AIS-receivers in a remote location with low to no AIS-traffic that services a SAR function in the area.
Both Kplex:es on both Rpi:s are experiencing "Too many open files" from time to time. If kplex is restarted, problem is solved.
From what i can find (with my limited network knowledge) the issue comes from marinetraffic.com (from now on MT) expects NMEA-packets every 10 seconds or less. If no data is received they send a TCP FIN to the client and asks to end the connection. This probably for performance reasons.
If traffic then IS being sent by the client after these 10 seconds, MT responds with a RST which probably is a more harsh way to tell kplex that the listening socket in the other end is closed. (The AIS-traffic in the example below is a keepalive script that injects an NMEA-sentence to kplex every minute)
What i think this gives, is a lot of open sockets(?) which over time reaches a limit where kplex is not allowed to create any more (1024 max)
Not sure if this is due to how MT handles the connection or if this is an issue with kplex or my installation specifically.
As for the issue for me, its looks to be handled by adjusting the rate of keepalivepackets below 10 seconds. I have also read about the keepalive function that has been added to kplex. Still the number of unclosed sockets is an issue that perhaps could happen to others.
Details:
Running version 1.4-55-ga7d726b (develop branch Aug 4, 2022)
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
The text was updated successfully, but these errors were encountered: