I’m setuping Grafana on Ubuntu machine with 8 cores CPU and 32GB RAM.
My architecture include:
- Grafana running on Docker container
- Nginx proxy on another container
- PostgreSQL as datasource running on another container
Now Grafana is connected to Postgres DB, with read-only role.
My dashboard has about 15 different panels and 3 main variable filters that all queries are depends on.
My issue is that grafana is performing very very slow, both on load time and on each panel refresh.
I’ve inspected the queries it makes and it looks that some of the queries returns after few seconds, while other after few minutes. I have another container running Django webapi that is used to insert the data to DB, and while grafana is running the queries to DB, the whole Host machine became very slow, preventing from other clients of the Postgres to run queries in parallel.
I’ve tested the same dashboard on another PC where grafana is installed directly on the main ubuntu OS, without docker, running Postgres the same way without docker, and the performance is way better, without any lag.
I’ll only add that the variable filters on my dashboard are creating very long queries when for instance “ALL” is selected on “customer” filter. Where customer is a multi-choice drop-down of 2K values.
I know that long queries can lead to performance issues, but with the same datasource on another machine of the same power, grafana performs very smooth, considering that it’s installed directly on the host, and not using nginx reverse proxy or docker container.