From f8ab11bd118c5fec3752ab2e273fc6a9a8dceacc Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Fri, 19 Nov 2021 03:19:37 -0500 Subject: [PATCH] Docs: Add configuration option for the image renderer (#41798) (#41916) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Docs: add configuration option for the image renderer * Apply review feedback (cherry picked from commit e904f423e4f8caf495c285e4fc28fbcc44638048) Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com> --- conf/defaults.ini | 6 ++++-- conf/sample.ini | 6 ++++-- docs/sources/administration/configuration.md | 10 ++++++++-- docs/sources/image-rendering/_index.md | 6 ++++-- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 5022515212c..307e2b33ea0 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -1040,12 +1040,14 @@ rendering_chrome_bin = # Mode 'reusable' will have one browser instance and will create a new incognito page on each request. rendering_mode = -# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser' +# When rendering_mode = clustered, you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser' # and will cluster using browser instances. # Mode 'context' will cluster using incognito pages. rendering_clustering_mode = -# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently.. +# When rendering_mode = clustered, you can define the maximum number of browser instances/incognito pages that can execute concurrently. Default is '5'. rendering_clustering_max_concurrency = +# When rendering_mode = clustered, you can specify the duration a rendering request can take before it will time out. Default is `30` seconds. +rendering_clustering_timeout = # Limit the maximum viewport width, height and device scale factor that can be requested. rendering_viewport_max_width = diff --git a/conf/sample.ini b/conf/sample.ini index 87089311c7e..e75d5130744 100644 --- a/conf/sample.ini +++ b/conf/sample.ini @@ -1012,12 +1012,14 @@ # Mode 'reusable' will have one browser instance and will create a new incognito page on each request. ;rendering_mode = -# When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser' +# When rendering_mode = clustered, you can instruct how many browsers or incognito pages can execute concurrently. Default is 'browser' # and will cluster using browser instances. # Mode 'context' will cluster using incognito pages. ;rendering_clustering_mode = -# When rendering_mode = clustered you can define maximum number of browser instances/incognito pages that can execute concurrently.. +# When rendering_mode = clustered, you can define the maximum number of browser instances/incognito pages that can execute concurrently. Default is '5'. ;rendering_clustering_max_concurrency = +# When rendering_mode = clustered, you can specify the duration a rendering request can take before it will time out. Default is `30` seconds. +;rendering_clustering_timeout = # Limit the maximum viewport width, height and device scale factor that can be requested. ;rendering_viewport_max_width = diff --git a/docs/sources/administration/configuration.md b/docs/sources/administration/configuration.md index 2939b94e448..7a27397ebda 100644 --- a/docs/sources/administration/configuration.md +++ b/docs/sources/administration/configuration.md @@ -1711,13 +1711,19 @@ Mode `reusable` will have one browser instance and will create a new incognito p ### rendering_clustering_mode -When rendering_mode = clustered you can instruct how many browsers or incognito pages can execute concurrently. Default is `browser` and will cluster using browser instances. +When rendering_mode = clustered, you can instruct how many browsers or incognito pages can execute concurrently. Default is `browser` and will cluster using browser instances. Mode `context` will cluster using incognito pages. ### rendering_clustering_max_concurrency -When rendering_mode = clustered you can define the maximum number of browser instances/incognito pages that can execute concurrently. +When rendering_mode = clustered, you can define the maximum number of browser instances/incognito pages that can execute concurrently. Default is `5`. + +### rendering_clustering_timeout + +> **Note**: Available in grafana-image-renderer v3.3.0 and later versions. + +When rendering_mode = clustered, you can specify the duration a rendering request can take before it will time out. Default is `30` seconds. ### rendering_viewport_max_width diff --git a/docs/sources/image-rendering/_index.md b/docs/sources/image-rendering/_index.md index 8bb9130431a..93efc8bccde 100644 --- a/docs/sources/image-rendering/_index.md +++ b/docs/sources/image-rendering/_index.md @@ -72,7 +72,7 @@ RENDERING_MODE=default #### Clustered -With the `clustered` mode, you can configure how many browser instances or incognito pages can execute concurrently. Default is `browser` and will ensure a maximum amount of browser instances can execute concurrently. Mode `context` will ensure a maximum amount of incognito pages can execute concurrently. You can also configure the maximum concurrency allowed, which per default is `5`. +With the `clustered` mode, you can configure how many browser instances or incognito pages can execute concurrently. Default is `browser` and will ensure a maximum amount of browser instances can execute concurrently. Mode `context` will ensure a maximum amount of incognito pages can execute concurrently. You can also configure the maximum concurrency allowed, which per default is `5`, and the maximum duration of a rendering request, which per default is `30` seconds. Using a cluster of incognito pages is more performant and consumes less CPU and memory than a cluster of browsers. However, if one page crashes it can bring down the entire browser with it (making all the rendering requests happening at the same time fail). Also, each page isn't guaranteed to be totally clean (cookies and storage might bleed-through as seen [here](https://bugs.chromium.org/p/chromium/issues/detail?id=754576)). @@ -80,6 +80,7 @@ Using a cluster of incognito pages is more performant and consumes less CPU and RENDERING_MODE=clustered RENDERING_CLUSTERING_MODE=browser RENDERING_CLUSTERING_MAX_CONCURRENCY=5 +RENDERING_CLUSTERING_TIMEOUT=30 ``` ```json @@ -88,7 +89,8 @@ RENDERING_CLUSTERING_MAX_CONCURRENCY=5 "mode": "clustered", "clustering": { "mode": "browser", - "maxConcurrency": 5 + "maxConcurrency": 5, + "timeout": 30 } } }