IzakMarais / reporter

Service that generates a PDF report from a Grafana dashboard
Apache License 2.0
964 stars 309 forks source link

Threading causing issues #40

Closed cchance27 closed 6 years ago

cchance27 commented 6 years ago

So i am trying to build a rather large grafana report its a good bit of graphs, which works in the webui, tho is slow but it appears that because you run the grab wide open and don't have a way to throttle to say only grab say 3-4 images at a time, it dumps maybe 50-100 graphs all to the grafana server at once and well lets just say it doesn't go well...

It bogs down the CPU and memory shoots to 4+ gigs on grafana, basically phantomjs from grafana gets stuck and ends up timing out on all the images, and without cpu/mem limits on the container will actually crash the server.

Would be nice if their was a way to limit how many graphs at a time to fetch from grafana, or at minimum to disable async and just grab each image synchronously (the slow way) ....

https://imgur.com/a/LKCXL

IzakMarais commented 6 years ago

I've limited the number of concurrent fetches to 5 in https://github.com/IzakMarais/reporter/commit/c795af54edb876c2caa37bcf9a0f326d305a01ad. Before I merge it into master, can you check out the branch limit-concurrent-fetches and see if it solves your problem?