I’m creating a simulation that uses influxDB (via the golang client) to store data. Writing the information is very quick, but the query from the client to the server takes longer than I am hoping for, since I am trying to update the simulation multiple times a second.
If the query rate occurs faster than once per second, the response somehow stalls, with the updated information regarding the query lagging behind the actual query rate. For example, if the client asks for information at a specific timestamp every 0.25 seconds, it will take about ~3 seconds before the simulation begins sending back fresh data about that specific timestamp - everything before that will be using older data with different timestamps.
Inversely, if the client asks for info every 1 second, it will only take 1 second to send back the updated data. I think this is the sign of a network bottleneck, but I’m not sure if it’s possible to avoid it.
How can I speed up the query process and avoid network bottlenecks in order to query multiple times every second?