Incosistent query times accessing InfluxDB Serverless from Python Flask app

We have recently migrated to InfluxDB Cloud Serverless and are currently seeing incosisntent query times when accessing data from the instance.

We use the FlightSQLClient as described in the Python tutorial which we intialize and close on the fly when the client is needed.

The problem is that the query times are incosistent. Ranging from <1 second to the full timeout of 10 seconds. Because the queries are fast every now and then I believe the issue does not lie in our query design but that it has something to do with how we initialize and handle the FlightSQLClient. Should we be creating a Singleton of the client when spinning up an instance? Are their concurrency issues when multiple instances try and use a similar FlightSQLClient to access Influx?

Any information on the topic is welcom.

4 Likes

I have the exact same issue but wth Javascript and “@influxdata/influxdb3-client”: “^0.2.0” with Cloud Functions (client is recreated on each call).

I’ve contacted the support and they couldn’t assist me without a support plan. They suggested that the initial request time was caused by Influxdb not having loaded the data in memory.

What seems strange to me is that request 4 is very fast (560 ms) while the next request executed instantly after is taking more than 10 seconds.

The support suggested that because I was querying 5 years of data it could be long, but the tag selected only contains 60 data points over these 5 years so I don’t really know if it could be an issue.