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
{{ message }}
This repository was archived by the owner on Oct 29, 2024. It is now read-only.
Operating system version: unsure - running on AWS and assume Linux
Using the Python InfluxDB client behind an AWS NAT gateway
The AWS NAT gateway will time out an idle connection after 350 seconds. The InfluxDB Python library uses the Python requests module under the hood to create a session and make all of the InfluxDB API calls using that session. While requests supports keep-alive (https://requests.readthedocs.io/en/latest/user/advanced/#keep-alive) it does not set the TCP socket to use keep alive and send ping probes to keep the connection from appearing to be idle. To work around this issue, the following code enables TCP keep-alives, which starts sending keep-alive probes after the connection has been idle for 60 seconds, sends a probe every 60 seconds and sends a maximum of 15 keep alive probes.