Skip to content

Commit

Permalink
[helm] add results cache (#1993)
Browse files Browse the repository at this point in the history
* [helm] Add query-frontend results cache

Fixes grafana/helm-charts#1403

* Add PR to CHANGELOG

Signed-off-by: Patrick Oyarzun <patrick.oyarzun@grafana.com>

* Fix README

Signed-off-by: Patrick Oyarzun <patrick.oyarzun@grafana.com>
  • Loading branch information
Logiraptor committed Jun 2, 2022
1 parent 85a0fb2 commit 81e9935
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 4 deletions.
8 changes: 8 additions & 0 deletions operations/helm/charts/mimir-distributed/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ Entries should be ordered as follows:

Entries should include a reference to the Pull Request that introduced the change.

## 2.1.0-beta.5

* [ENHANCEMENT] Add support for the results cache used by the query frontend #1993
- This will result in additional resource usage due to the addition of one or
more memcached replicas. This applies when using small.yaml, large.yaml,
capped-large.yaml, capped-small.yaml, or when setting
`memcached-results.enabled=true`

## 2.1.0-beta.4

* [BUGFIX] Set up using older bitnami chart repository for memcached as old charts were deleted from the current one. #1998
Expand Down
7 changes: 5 additions & 2 deletions operations/helm/charts/mimir-distributed/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ dependencies:
- name: memcached
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
version: 5.5.2
- name: memcached
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
version: 5.5.2
- name: minio
repository: https://helm.min.io/
version: 8.0.10
digest: sha256:e8e0973e775bc3408e5f3d7a44226230ce5a7af9debcb60b7882b309960851a4
generated: "2022-06-02T14:41:16.020882885+02:00"
digest: sha256:0b58716cf86880510e4ce9dacb312db80918d14704e68127b833b81b5fd7d7f3
generated: "2022-06-02T09:31:09.709064-05:00"
7 changes: 6 additions & 1 deletion operations/helm/charts/mimir-distributed/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
version: 2.1.0-beta.4
version: 2.1.0-beta.5
appVersion: 2.0.0
description: "Grafana Mimir"
engine: gotpl
Expand All @@ -23,6 +23,11 @@ dependencies:
version: 5.5.2
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
condition: memcached-metadata.enabled
- name: memcached
alias: memcached-results
version: 5.5.2
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
condition: memcached-results.enabled
- name: minio
alias: minio
version: 8.0.10
Expand Down
3 changes: 2 additions & 1 deletion operations/helm/charts/mimir-distributed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Helm chart for deploying [Grafana Mimir](https://grafana.com/docs/mimir/v2.0.x/)

# mimir-distributed

![Version: 2.1.0-beta.4](https://img.shields.io/badge/Version-2.1.0--beta.4-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square)
![Version: 2.1.0-beta.5](https://img.shields.io/badge/Version-2.1.0--beta.5-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square)

Grafana Mimir

Expand All @@ -18,6 +18,7 @@ Kubernetes: `^1.10.0-0`
| https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami | memcached(memcached) | 5.5.2 |
| https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami | memcached-queries(memcached) | 5.5.2 |
| https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami | memcached-metadata(memcached) | 5.5.2 |
| https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami | memcached-results(memcached) | 5.5.2 |

## Dependencies

Expand Down
3 changes: 3 additions & 0 deletions operations/helm/charts/mimir-distributed/capped-small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ memcached-queries:
memcached-metadata:
enabled: true

memcached-results:
enabled: true

minio:
enabled: false

Expand Down
4 changes: 4 additions & 0 deletions operations/helm/charts/mimir-distributed/large.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ memcached-queries:
memcached-metadata:
enabled: true

memcached-results:
enabled: true
replicaCount: 4

minio:
enabled: false

Expand Down
3 changes: 3 additions & 0 deletions operations/helm/charts/mimir-distributed/small.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ memcached-queries:
memcached-metadata:
enabled: true

memcached-results:
enabled: true

minio:
enabled: false

Expand Down
40 changes: 40 additions & 0 deletions operations/helm/charts/mimir-distributed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ mimir:
frontend:
log_queries_longer_than: 10s
align_queries_with_step: true
{{- if index .Values "memcached-results" "enabled" }}
results_cache:
backend: memcached
memcached:
addresses: dns+{{ .Release.Name }}-memcached-results.{{ .Release.Namespace }}.svc:11211
max_item_size: {{ (index .Values "memcached-results").maxItemMemory }}
cache_results: true
{{- end }}
compactor:
data_dir: "/data"
Expand Down Expand Up @@ -1060,6 +1068,38 @@ memcached-metadata:
# memory requests should be exceed memcached -m flag
memory: 614Mi # (floor (* 1.2 512))

memcached-results:
enabled: false
architecture: high-availability
arguments:
- -m 512
- -o
- modern
- -v
- -I 1m
- -c 1024
image:
repository: memcached
tag: 1.6.9
# maxItemMemory is in bytes. Should match memcached -I flag (which is in MB)
# It is a string to avoid https://github.com/helm/helm/issues/1707.
maxItemMemory: '1048576' # (* 1 (* 1024 1024))
metrics:
enabled: true
image:
registry: quay.io
repository: prometheus/memcached-exporter
tag: v0.9.0
replicaCount: 1
resources:
limits:
# memory limits should match requests
memory: 614Mi
requests:
cpu: 500m
# memory requests should be exceed memcached -m flag
memory: 614Mi # (floor (* 1.2 512))

minio:
enabled: true
accessKey: grafana-mimir
Expand Down

0 comments on commit 81e9935

Please sign in to comment.