Influxdb 2 stops when grafana query 500+ tag metrics simultaneously

I have influxdb2-2.7.11-windows running with 3000+ tags loaded by telegraf which pulls data from opcua server. Grafana V12.0.0 running in ubuntu server has 500+ stat panels using fluxql for the influxdb datasource. The problem is when every time grafana started to query from all 500 stat panels influxdb2 is getting stopped after sometime. I checked ran influxdb2 with grafana service stopped and influxdb2 running normal .also another web application query data from influxdb but it is running normal.
Below is the query used in grafana and please provide solution to fix this problem,
field = “027-002-PROC-PRS-IPT0503-PV”
from(bucket: “telegraf”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “opcua_listener”)
|> filter(fn: (r) => r[“_field”] == field)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> drop(columns: [“host”, “id”, “_start”, “_stop”])

It is likely caused by query overload when Grafana starts 500+ panels simultaneously, overwhelming InfluxDB’s memory and causing it to crash. The solution is to limit concurrent queries in InfluxDB v2 using --query-concurrency and --query-max-memory-bytes settings, and stagger Grafana panel refresh times to avoid all 500 queries hitting at once.