node-influx: Error: connect ETIMEDOUT or "No host available"
I’m playing with InfluxDB, writing about 5 points per second individually with writePoint(). The payload is small (one field, one tag), but after the script runs for 3-4 minutes, I start getting connect ETIMEDOUT or No host available errors in the callback. The client is on my local machine and the server is a relatively beefy VPS with 2 CPU cores and 2GB RAM, not running much else.
Has anyone else seen this issue? I haven’t found anything at https://github.com/influxdata/influxdb/issues.
I can of course buffer the writes into an array of values and use writePoints(), but I thought InfluxDB was designed for high-performance data intake.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 16 (8 by maintainers)
We saw a similar situation when connecting to an influx cloud instance. Their support team recommended that we batch our writes as much as we can. It appears that influx doesn’t like lots of small posts.
This probably isn’t a bug in the adapter; ETIMEDOUT will cause the adapter to treat the host as being down, removing it from the connection pool for a certain amount of time, causing the
No host availableerror. I would try writing a super simple bash script that writes points with thecurlcommand and see if you get time outs there…Node Influx will also raises a “No host available” error when you try to push to a measurement with a certain retention policy, yet you haven’t created this retention policy
The Influx community forums can be found here: https://community.influxdata.com/
I would expect that, in your scenario, Inlfux would be logging something that says why it isn’t accepting writes.