Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions development/capacity-test/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
CORTEX_VERSION=latest
GRAFANA_VERSION=10.4.2
PROMETHEUS_VERSION=v3.2.1
SEAWEEDFS_VERSION=3.67
68 changes: 68 additions & 0 deletions development/capacity-test/cortex-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Cortex configuration for capacity testing in microservices mode.
# Runs distributor, ingester, querier, and store-gateway as separate
# containers using memberlist for ring discovery (no Consul needed).

auth_enabled: true

server:
grpc_server_max_recv_msg_size: 104857600
grpc_server_max_send_msg_size: 104857600
grpc_server_max_concurrent_streams: 1000

distributor:
shard_by_all_labels: true
pool:
health_check_ingesters: true

ingester_client:
grpc_client_config:
max_recv_msg_size: 104857600
max_send_msg_size: 104857600
grpc_compression: gzip

ingester:
lifecycler:
min_ready_duration: 0s
final_sleep: 0s
num_tokens: 512
ring:
kvstore:
store: memberlist
replication_factor: 1

blocks_storage:
backend: s3
s3:
endpoint: seaweedfs:8333
region: local
bucket_name: cortex-blocks
access_key_id: any
secret_access_key: any
insecure: true
tsdb:
dir: /data/tsdb
bucket_store:
sync_dir: /data/tsdb-sync
bucket_index:
enabled: true

compactor:
data_dir: /tmp/cortex/compactor
sharding_ring:
kvstore:
store: memberlist

store_gateway:
sharding_enabled: true
sharding_ring:
replication_factor: 1
wait_stability_min_duration: 0s
kvstore:
store: memberlist

frontend_worker:
match_max_concurrent: true

memberlist:
join_members:
- ingester:7946
118 changes: 118 additions & 0 deletions development/capacity-test/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
services:
distributor:
image: quay.io/cortexproject/cortex:${CORTEX_VERSION}
command:
- -config.file=/config/cortex-config.yaml
- -target=distributor
- -server.http-listen-port=8001
- -server.grpc-listen-port=9001
volumes:
- ./cortex-config.yaml:/config/cortex-config.yaml:ro
depends_on:
ingester:
condition: service_started
ports:
- "8001:8001"
healthcheck:
test: wget -qO- http://127.0.0.1:8001/ready
interval: 10s
timeout: 10s
retries: 3
restart: on-failure
ingester:
image: quay.io/cortexproject/cortex:${CORTEX_VERSION}
command:
- -config.file=/config/cortex-config.yaml
- -target=ingester
- -server.http-listen-port=8002
- -server.grpc-listen-port=9002
volumes:
- ./cortex-config.yaml:/config/cortex-config.yaml:ro
ports:
- "8002:8002"
healthcheck:
test: wget -qO- http://127.0.0.1:8002/ready
interval: 10s
timeout: 10s
retries: 3
restart: on-failure
querier:
image: quay.io/cortexproject/cortex:${CORTEX_VERSION}
command:
- -config.file=/config/cortex-config.yaml
- -target=querier
- -server.http-listen-port=8003
- -server.grpc-listen-port=9003
volumes:
- ./cortex-config.yaml:/config/cortex-config.yaml:ro
depends_on:
ingester:
condition: service_started
ports:
- "8003:8003"
healthcheck:
test: wget -qO- http://127.0.0.1:8003/ready
interval: 10s
timeout: 10s
retries: 3
restart: on-failure
store-gateway:
image: quay.io/cortexproject/cortex:${CORTEX_VERSION}
command:
- -config.file=/config/cortex-config.yaml
- -target=store-gateway
- -server.http-listen-port=8004
- -server.grpc-listen-port=9004
volumes:
- ./cortex-config.yaml:/config/cortex-config.yaml:ro
depends_on:
ingester:
condition: service_started
ports:
- "8004:8004"
healthcheck:
test: wget -qO- http://127.0.0.1:8004/ready
interval: 10s
timeout: 10s
retries: 3
restart: on-failure
grafana:
image: grafana/grafana:${GRAFANA_VERSION}
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_USERS_DEFAULT_THEME=light
- GF_LOG_MODE=console
- GF_LOG_LEVEL=critical
volumes:
- ./grafana-datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml:ro
- ../../docs/getting-started/grafana-dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:ro
- ../../docs/getting-started/dashboards/:/var/lib/grafana/dashboards/:ro
ports:
- "3000:3000"
prometheus:
image: prom/prometheus:${PROMETHEUS_VERSION}
command:
- --config.file=/config/prometheus-config.yaml
volumes:
- ./prometheus-config.yaml:/config/prometheus-config.yaml:ro
ports:
- "9090:9090"
seaweedfs:
image: chrislusf/seaweedfs:${SEAWEEDFS_VERSION}
command:
- server
- -s3
- -s3.config=/workspace/seaweedfs-config.json
ports:
- "8333:8333"
post_start:
- command: /seaweedfs-init.sh
volumes:
- ../../docs/getting-started/seaweedfs-config.json:/workspace/seaweedfs-config.json:ro
- ../../docs/getting-started/seaweedfs-init.sh:/seaweedfs-init.sh:ro
healthcheck:
test: wget -qO- http://127.0.0.1:8333/status
interval: 10s
timeout: 10s
retries: 3
32 changes: 32 additions & 0 deletions development/capacity-test/grafana-datasource.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Grafana datasource configuration for capacity test (microservices mode).
# Queries go through the querier service.
apiVersion: 1

datasources:
- name: Cortex (tenant-01)
type: prometheus
access: proxy
orgId: 1
url: http://querier:8003/api/prom
jsonData: &jsonData
cacheLevel: None
httpHeaderName1: X-Scope-OrgID
httpMethod: POST
prometheusType: Cortex
prometheusVersion: 1.14.0
timeInterval: 15s
secureJsonData:
httpHeaderValue1: tenant-01
version: 1
editable: true
isDefault: true
- name: Tenant 02
type: prometheus
access: proxy
orgId: 1
url: http://querier:8003/api/prom
jsonData: *jsonData
secureJsonData:
httpHeaderValue1: tenant-02
version: 1
editable: true
99 changes: 99 additions & 0 deletions development/capacity-test/prometheus-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# Prometheus configuration for capacity testing.
# Scrapes distributor and ingester separately so we can isolate
# ingester memory/CPU metrics from other components.
# Uses 25 tenants to increase series count and reduce the impact
# of fixed overhead on per-series estimates.
global:
scrape_interval: 15s
evaluation_interval: 15s

scrape_configs:
- job_name: "prometheus"
static_configs:
- targets: ["localhost:9090"]
- job_name: "distributor"
static_configs:
- targets: ["distributor:8001"]
- job_name: "ingester"
static_configs:
- targets: ["ingester:8002"]
- job_name: "querier"
static_configs:
- targets: ["querier:8003"]

remote_write:
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-01"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-02"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-03"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-04"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-05"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-06"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-07"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-08"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-09"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-10"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-11"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-12"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-13"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-14"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-15"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-16"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-17"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-18"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-19"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-20"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-21"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-22"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-23"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-24"
- url: http://distributor:8001/api/v1/push
headers:
X-Scope-OrgID: "tenant-25"
Loading
Loading