Speeding up a slow dashboard with high refresh rate and many data points

Hello all,

I’m working on setting up a data collection and visualization pipeline with InfluxDB and Grafana. While this will mostly be used for looking at logs after they have been recorded, I also need the ability to look at logs live with a relatively fast refresh. I have set-up my dashboard to be able to do 250ms refreshes, however I notice that if my time window is bigger than like 10s, it gets really slow. I can go up to 30s window if I only have 1 visualization but any more and I gotta go down to 10s. Everything down to just navigating the UI starts to lock up and it becomes quiet unresponsive even with 10s windows. I understand that this is likely because my data is coming in at up to 100Hz, and thus a 30s window of data is 3000 points, and it’s getting that query every 250ms, so it really adds up.

I was wondering if there is a way to optimize my query such that Grafana should only be pulling “new” data every time, rather than constantly pulling overlapping data with every query. I’m surprised it doesn’t do this by default, but perhaps it’s just a problem with my query. (side note, for what I’m doing I can’t do aggregate queries, I do need to be able to plot every point in the window because small variations are very important to what is being observed).

right now my query looks like this:

from(bucket: "example-bucket")
   |> filter(fn: (r) => r._measurement == "example-measurement")

A log will have anywhere from 2-5 fields, and all will be plotted (which is why i don’t filter for them in the query).

Now I also know that this is not the ideal setup for “live” plotting, however I would rather only have 1 data stream rather that have my client application also start an MQTT stream separately for “live” view. I’m ok with taking a slight fluidity hit to keep things working purely off influx, so if there’s a way this can be optimized to speed up the dashboard, that would be great!