Intermittent connection refused for influxdb

Failed to connect to http:/IP:8086: Get http://myip:8086/ping: dial tcp myip:8086: connect: connection refused
Please check your connection settings and ensure ‘influxd’ is running.

get intermittently error 503 bad gateway randomly on grafana for influx and notice when look at my logs it take a while to open the the files as well as connection refused. Is there any ideas to solve the problem. It appears to be intermittent as sometimes see the data and access influx.
influxd: tmsg=“Opened shard” index_version=inmem path=/var/lib/influxdb/data/kpi/autogen/223 duration=252513.478ms
InfluxDB shell version: 1.8.0

Would need to look at the server side logs to be sure.

Few ideas,

influxd might be running out of memory and terminating , and getting auto restarted by systemd, or kubernetes if you’re using that.

Are you noticing the unreachable errors around the time when you run a query or when a few queries execute at the same time (CQ / tasks) ?

Yes it happens when running queries. How can that be fixed?

Influxdb2 is still in beta at present, and not meant for performance testing just yet. And still need to identify what the issue is before we get to how it can be fixed.

Do you have access to the server side logs, or are you on a cloud instance?

First, Are you running the queries manually or are they tasks?

Can you find which ones running together cause the issue. Does that occur with any consistency/pattern?

If yes, can you then past those queries inside a </> code block