Skip to content

Commit

Permalink
Add support for memcaches (#564)
Browse files Browse the repository at this point in the history
* vendor: update cortex

Don't be blocked on cortexproject/cortex#1345 to
be merged and still maintain the fork

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* add memcached ksonnet

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>

* commit generated proto

Signed-off-by: Goutham Veeramachaneni <gouthamve@gmail.com>
  • Loading branch information
gouthamve authored May 14, 2019
1 parent 87d25fa commit 0e86bfd
Show file tree
Hide file tree
Showing 29 changed files with 397 additions and 263 deletions.
4 changes: 2 additions & 2 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 38 additions & 0 deletions production/ksonnet/loki/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,44 @@
gcs: {
bucket_name: $._config.gcs_bucket_name,
},

index_queries_cache_config: {
memcached: {
batch_size: 100,
parallelism: 100,
},

memcached_client: {
host: 'memcached-index-queries.%s.svc.cluster.local' % $._config.namespace,
service: 'memcached-client',
},
},
},

chunk_store_config: {
chunk_cache_config: {
memcached: {
batch_size: 100,
parallelism: 100,
},

memcached_client: {
host: 'memcached.%s.svc.cluster.local' % $._config.namespace,
service: 'memcached-client',
},
},

write_dedupe_cache_config: {
memcached: {
batch_size: 100,
parallelism: 100,
},

memcached_client: {
host: 'memcached-index-writes.%s.svc.cluster.local' % $._config.namespace,
service: 'memcached-client',
},
},
},

schema_config: {
Expand Down
10 changes: 10 additions & 0 deletions production/ksonnet/loki/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
}
},
"version": "master"
},
{
"name": "memcached",
"source": {
"git": {
"remote": "https://github.com/grafana/jsonnet-libs",
"subdir": "memcached"
}
},
"version": "master"
}
]
}
7 changes: 5 additions & 2 deletions production/ksonnet/loki/loki.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
(import 'config.libsonnet') +
(import 'consul/consul.libsonnet') +

// Cortex services
// Loki services
(import 'distributor.libsonnet') +
(import 'ingester.libsonnet') +
(import 'querier.libsonnet') +
(import 'table-manager.libsonnet')
(import 'table-manager.libsonnet') +

// Supporting services
(import 'memcached.libsonnet')
21 changes: 21 additions & 0 deletions production/ksonnet/loki/memcached.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
local memcached = 'memcached/memcached.libsonnet';

memcached {
// Memcached instance used to cache chunks.
memcached_chunks: $.memcached {
name: 'memcached',
max_item_size: '2m',
memory_limit_mb: 4096,
},

// Dedicated memcached instance used to temporarily cache index lookups.
memcached_index_queries: $.memcached {
name: 'memcached-index-queries',
max_item_size: '5m',
},

// Dedicated memcached instance used to dedupe writes to the index.
memcached_index_writes: $.memcached {
name: 'memcached-index-writes',
},
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions vendor/github.com/cortexproject/cortex/pkg/chunk/cache/cache.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 0e86bfd

Please sign in to comment.