We run an MQTT broker on Fly (TCP service on 8883 with handlers = ["tls"], MQTT keepalive 270 s). Our clients are battery-powered LTE-M devices.
The Fly edge sends a zero-length TCP keepalive probe on every idle client connection about every 5.12 s. The first probe comes 2–5 s after the last data. Our app never sees this traffic: the server-side socket shows only the MQTT PINGREQ/PINGRESP every 270 s.
Captured on fixed broadband (macOS, idle connection to a Fly app on 66.241.125.92:443):
07:55:24.198873 IP 66.241.125.92.443 > 192.168.1.176.59731: Flags [.], ack 67, win 1024, length 0
07:55:24.199066 IP 192.168.1.176.59731 > 66.241.125.92.443: Flags [.], ack 90, win 2048, length 0
07:55:29.318453 IP 66.241.125.92.443 > 192.168.1.176.59731: Flags [.], ack 67, win 1024, length 0
07:55:29.318634 IP 192.168.1.176.59731 > 66.241.125.92.443: Flags [.], ack 90, win 2048, length 0
07:55:34.438639 IP 66.241.125.92.443 > 192.168.1.176.59731: Flags [.], ack 67, win 1024, length 0
07:55:34.438854 IP 192.168.1.176.59731 > 66.241.125.92.443: Flags [.], ack 90, win 2048, length 0
07:55:39.558423 IP 66.241.125.92.443 > 192.168.1.176.59731: Flags [.], ack 67, win 1024, length 0
A modem trace from the device on 8883 shows the same probe (seq = snd_una − 1, length 0) every 5.12 s for hours.
On cellular, every probe pages the device and forces an RRC connection. Measured overnight it costs about 1.4 MB/day per device, more than 40 MB/month of pure keepalive. It also keeps the radio connected about 80 % of the time, which kills battery life. The connection itself is healthy: the device answers every probe.
From TCP idle timeouts restrictions have been removed we understand the edge sets SO_KEEPALIVE / TCP_KEEPIDLE / TCP_KEEPINTVL / TCP_KEEPCNT / TCP_USER_TIMEOUT on client sockets. We couldn’t find these values or any setting for them in the docs.
Questions:
- Is ~5 s really the intended TCP_KEEPIDLE/TCP_KEEPINTVL for client-side edge connections?
- Can it be raised (e.g. ≥ 300 s) or disabled per app or per service, for example as an option under
[[services.ports]]? The application already has its own keepalive. - If not, what is the recommended way to serve long-lived, mostly idle TCP connections to cellular clients on Fly?
Thanks!