grafana / grafana-zabbix

Zabbix plugin for Grafana dashboard
http://play.grafana-zabbix.org
Apache License 2.0
2.06k stars 458 forks source link

Grafana dashboard is very slow at pulling data from Zabbix/MySQL #1185

Open thesocialproxy opened 3 years ago

thesocialproxy commented 3 years ago

Describe the bug Grafana dashboard is very slow at pulling data from Zabbix/MySQL, I have already increased the memory limit to 512MB and also tried to use the direct DB connection, but I am getting the same results, displaying the data from the last 12 hours can take up to minutes.

Expected behavior Data is displayed within seconds.

Screenshots

Screen Shot 2021-04-02 at 8 04 32 PM Screen Shot 2021-04-02 at 8 04 24 PM Screen Shot 2021-04-02 at 8 04 10 PM

Software versions Grafana v7.4.0 Zabbix 5.0.9 Plugin v4.1.4

mike-sol commented 3 years ago

Depending on how busy your MySQL is, this is pretty normal. MySQL is not a time series database so it lacks some of the niceties that other backends for metrics have in terms of rolling up averages over time so as to not have to query every value every time etc.

Can you scale your MySQL up? Is it tuned? How long do graphs take to return in the Zabbix UI?

wangxin688 commented 3 years ago

strongly recommend for timescaledb. it's works fine in over product environment,over 1 million items.

alexanderzobnin commented 3 years ago

Unfortunately, this is something out of my control. Looks like your dashboard is pulling lots of items, so the only thing plugin can do is just send an API request and wait for result. Direct DB connection can help in this case since it builds SQL query that reduces amount of points significantly on large time ranges. Compare response size for API (zabbix-api endpoint) and DB (query endpoint) queries:

Screen Shot 2021-04-02 at 8 04 10 PM

~ 10 MB for SQL queries and ~100 MB for API. Also, failed request use API calls, so maybe you haven't configured it properly to use direct DB connection.

github-actions[bot] commented 1 month ago

This issue has been automatically marked as stale because it has not had activity in the last 2 years. It will be closed in 60 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!