-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image renderer plugin: rendering horribly slow #124
Comments
Can you please rewrite the issue using our standard template? Thanks! |
We have the proper template now ;) Are there any plans for improving image render performance? |
I don't know to be honest, not so involved with it yet personally. |
@andig if you use remote rendering using docker instead of the plugin there's experimental/unofficial support for reusing a browser, see grafana-image-renderer/src/app.ts Lines 118 to 128 in 6ac82cf
|
Think I do ;):
Now, as soon as I add the
Unfortunately, the image retrieval now ends in an HTTP 500 while it used to work before, no additional errors in the log. |
@andig please do a What's the 500 details? |
I constantly have >5s for a single user/image. That is pretty unusable.
No update (container recreated):
It seems the request is working from command line and produces the expected PNG on disk:
...but not from integrated into website (yet working without the parameter), copied from Safari dev tools:
Adding all the headers to curl works:
I can understand it you want to treat this as individual issue. Would however be happy to turn on any logging that might indicate cause of the 500 from server side. |
I‘ve checked that‘s the tag of 1.0.11 (https://hub.docker.com/r/grafana/grafana-image-renderer/tags) |
I have also added grafana-image-renderer/src/app.ts Line 131 in 23f90be
Verified this doubt using the grafana logs:
|
I've meanwhile found the
It seems this is happening when invoking the renderer before the browser has actually started. I can now reproducibly generate panels with the reusable browser. Unfortunately, it is still as slow as before. Rendering takes more than 5s even for a single panel. |
Chromium/puppeteer performance in docker is a tricky thing. I did read up on this article and this earlier and tried some of the suggestions, but didn't make that big of a difference according to my tests. A big difference with browserless article and Grafana image rendering is that it's tricky to cache assets since it can be a potential security issue due to cookie is being sent with request to Grafana. But a potential improvement could be to use an HTTP header instead. Currently, we have no plans focusing on improving performance. But if anyone have experience optimizing puppeteer/chromium/chrome performance any information/help would be very valuable. You can enable metrics and scrape /metrics using Prometeheus to be able to measure performance over time. You can find some additional information looking at the load test setup:
HA setup includes cadvisor to gather memory and CPU metrics and more. You can try the You can try grafana/grafana-image-renderer:1.0.12-beta1 with the following environment variable and see if you see any difference in performance: Here's a reference to all command line switches for Chromium that can be provided through environment variable RENDERING_ARGS: https://peter.sh/experiments/chromium-command-line-switches/ You may also want to experiment with the Dockerfile and build a custom one in case that makes a different. |
I have an Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz here as a single server. And phantomjs was acceptable fast. But the new image rendering plugin takes ages to render something |
Could you share how long it takes for you? My platform may not be typical, but I can share that- even plugin is used and only a single image rendered- rendering times are >10s. @marefr that said, tuning would not be about clustering or concurrency but about single image render time when system idle. |
~6 seconds for my system for a single image. But the webpages usually include 4 or more images |
We use a plugin for our icinga2 monitoring environment icingaweb2-module-grafana which is also dependent on the image rendering. So with the new image-renderer it takes also ~5-10 seconds for a single image on the webpage. As in the first post mentioned, faster image rendering would be desirable. |
We use the same Icinga2 setup and it took about 4s to render the image. |
+1 from me. We also use the same Icinga2 setup and about ~3 secs to render. also tried the clustered and reusable mode. Both didnt increased the performance. The Server is bare metal and has enough performance (64GB RAM, 16 Core E3 CPU) Performance before we used this plugin was way higher (with grafana integrated rendering) |
Sorry to bombard this thread, but same problem here. We have 4 different Icinga2 installations all with Grafana integrated. After having to use the new renderer the performance is really bad compared to what it was before. Two of our installations are on bare metal and two are VM's. One of the bare metals is a high performance server with a fresh install of Icinga2/Grafana with only self checks enabled. The performance is sluggish on all installations. |
We also use the same Icinga2 setup and about ~3 secs to render. |
I appreciate the feedback as it shows that the performance problems are not specific to my low-end platform. |
We are seeing similar issue here, in Grafana 6.x, the average rendering latency is 3s, after Grafana v7 with remote image renderer plugin, the average went up to 5+s consistently. |
We can confirm this issue, after updating our icingaweb2 plugin with grafana 7 and the grafana-image-renderer, the render time of images increase by 4 or 5 times. Has Anyone suggestions for options in the grafana.ini to speed up the process? |
Same here - Grafana 6.x was on 5s on average which didn't pass our UAT, upgrading to Grafana 7.x with remote image renderer plugin only increased rendering time to 6-7s on average (both running in docker container) |
Same here, |
@marefr seems there are a number of reports of actual performance degradation now, both on high-end platforms and concerning single image rendering (instead of performance under load). My understanding was that the render plugin should come with a pre-booted browser and hence have the potential to increase performance as bootstrap efforts are eliminated. The opposite seems to be the effect. Is there any detail/ insights we could provide to take this issue further? |
I'm still referring to #124 (comment). I understand you experience performance degradation, but since we don't it's very hard to investigate/do anything from out side. Help from you/the community is needed. |
Direct rendering of single image takes around 3-4 sec in dockerized Grafana (VMware, 8vCPU, 16GB RAM) with the new image renderer compared to 1-2 sec with PhantomJS. That is unbearably slow. I have tried every possible switch provided in this thread and Puppeteer docs, nothing seems to help. |
Anything new here? Would be very sad, if this issue will be ignored.... |
We need to speed up the process by minimum 2 times, 3-4 seconds are to slow compared to 1-2 seconds in previous versions. Reproduce:
|
I see two approaches for a better usage:
For any improvement, nobody should expect that it just will be done. Maybe someone can look into it and provide an implementation. The cause of the current problem is due to being forced to replace PhantomJS by a supported component, Chromium, which is slower in this way of using it. |
Any update on that issue? Rendering via Icinga2 Web is still horribly slow and havent found any optimization |
The issue is massive amount of JS (like FE request - single panel waiting until everything is loaded). You can change some stuff, but will not resolve major part of the loading time. It loads multiple JS Frameworks and runs them. |
so are there any alternatives or possibilities to improve the speed a bit? |
This issue is open for over 8 months now. I am really sad, that nothing is happening here. I am still stuck on Grafana 6, because I cannot expect my users to wait 10 seconds for a service overview with a grafana panel in Icingaweb2 :( |
Tried image renderer today, it is horrible slow (takes about 5s before image is displayed), so I can't use it. |
I tried to explore a way to avoid full page reloads between renders, here is a very simple POC #199 The first image takes the normal amount of time: 2-3 seconds The POC needs a lot more work the be production viable. If anyone want to help explore how to turn this POC into something more production viable, help is appreciated |
@torkelo |
Are there any news here? |
If you are using Icinga with Grafana plugin you may consider just using iFrame and directly pass the graph from GF inside the Icingaweb. There are numerous ways to reasonably secure the access. I opted for strictly defined CSP and Single-Sign-On. Anyway I think it's unrealistic to expect a solution to this from an open source with limited resources. |
also this would be an awnser maybe...so my question is: Is there a chance to improve performance in future? btw. in my case it needs 3.5 seconds to load the graph.....under 2 seconds would be imho acceptable |
Do you have a howto for this change please? |
Using iFrame is not a solution, when you have restrictions, who can use grafana and who not. When a user is allowed to see things in Icingaweb2, it does not mean, he is also allowed to use grafana itself, beside the page refresh will be distracted:
|
it's too bad that there seems no progress on this important issue :-( |
An iFrame is not a good solution. You just moving the problem to an unreliable resource depending on connection (speed and latency) and unkown cpu power. |
Never claimed it is a solution. It's something you may consider depending on your setup and possibilities. Smartphones are not relevant for us. I'd have thought it's quite obvious and does not need to be spelled out that it's something others may consider and not a proper solution. |
The server is normally as fast as the client, if the server has a similar speed. Only difference is you have no cache & also you see something loading. If you put an spinner/animation it has the same effect. If you need multiple graphs you can use the kiosk mode. Also a Pull Request is in WIP, you could patch it yourself and help testing. Basically reuse the chrome instance and don't restart the JS horror of Grafana again. for a single graph. |
I can confirm, in Grafana 7.5.9, it's still every slow. I havn't checked it in Grafana 8. |
In Grafana 8.0.5 the Problem still exists, and i found out it gets even worse if i activate SSL in the Grafana configuration. It now take aber 20 to 25 seconds to render an Image if SSL is activated. |
I have tried it out over the direct installation of the plugin and also with the image renderer as separate docker container: but both is slow (about 5s) |
@uebenes of course it is slow. Something will be referenced, like the WIP Pull Request on 10. Dec 2020. The solution complex. Always use the same instance with reload, so no init from all that JS stuff OR create a template for the renderer without unused JS Stuff (only us the needed stuff). In a perfect world, both things were implemented. |
UPDATE: our rendering was awfully slow ~ 30sec per Image, now we found out, that since we used a proxy for our grafana-server, the grafana-server it self could not connect to our CRL, now we added the crl to the no-proxy in the /etc/sysconfig/grafana-server configuration and our rendring is now much faster ~ 5 seconds. |
is there any upadates on this subject, we're running on grafana 7.3.1 and we're hitting 500 error since the rendering is too slow
|
What would you like to be added:
Improved image renderer plugin performance with panel rendering below 1s.
Why is this needed:
I'm running Grafana on an Intel-powered Synology NAS. Export of panels als PNGs or hot-linking to such PNGs is horribly slow as the time to generate them is between 5 and 15 seconds for a single panel. This is pretty much unusable except for batching purposes.
While the box is not top-notch it has sufficient performance and 12GB of memory that suffices to run my other docker workload.
With rollout of the renderer plugin (#106) it would be great if the performance could be enhanced, e.g. by keeping a headless chrome running instead of starting per image.
The text was updated successfully, but these errors were encountered: