Skip to content
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

set memory limits for all services #460

Merged
merged 6 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,7 @@ significant modifications will be credited to OpenTelemetry Authors.
[#432](https://github.com/open-telemetry/opentelemetry-demo/pull/432)
* Replaced the Jaeger exporter to the OTLP exporter in the OTel Collector
([#435](https://github.com/open-telemetry/opentelemetry-demo/pull/435))
* Set resource memory limits for all services
([#460](https://github.com/open-telemetry/opentelemetry-demo/pull/460))
* Update cartservice Dockerfile to support ARM64
([#439](https://github.com/open-telemetry/opentelemetry-demo/pull/439))
89 changes: 86 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ services:
jaeger:
image: jaegertracing/all-in-one
container_name: jaeger
command:
- "--memory.max-traces"
- "10000"
command: ["--memory.max-traces", "10000"]
environment:
- COLLECTOR_OTLP_ENABLED=true
deploy:
resources:
limits:
memory: 275M
restart: always
ports:
- "16686:16686" # Jaeger UI
- "4317" # OTLP gRPC default port
Expand All @@ -29,6 +32,11 @@ services:
otelcol:
image: otel/opentelemetry-collector-contrib:0.61.0
container_name: otel-col
deploy:
resources:
limits:
memory: 100M
restart: always
command: [ "--config=/etc/otelcol-config.yml", "--config=/etc/otelcol-config-extras.yml" ]
volumes:
- ./src/otelcollector/otelcol-config.yml:/etc/otelcol-config.yml
Expand All @@ -46,6 +54,11 @@ services:
redis-cart:
image: redis:alpine
container_name: redis-cart
deploy:
resources:
limits:
memory: 20M
restart: always
ports:
- "${REDIS_PORT}"
logging: *logging
Expand All @@ -59,6 +72,11 @@ services:
dockerfile: ./src/adservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-adservice
deploy:
resources:
limits:
memory: 300M
restart: always
ports:
- "${AD_SERVICE_PORT}"
environment:
Expand All @@ -80,6 +98,11 @@ services:
dockerfile: ./src/cartservice/src/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-cartservice
deploy:
resources:
limits:
memory: 160M
restart: always
ports:
- "${CART_SERVICE_PORT}"
environment:
Expand All @@ -102,6 +125,11 @@ services:
dockerfile: ./src/checkoutservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-checkoutservice
deploy:
resources:
limits:
memory: 20M
restart: always
ports:
- "${CHECKOUT_SERVICE_PORT}"
environment:
Expand Down Expand Up @@ -137,6 +165,11 @@ services:
args:
- GRPC_VERSION=1.46.0
- OPENTELEMETRY_VERSION=1.5.0
deploy:
resources:
limits:
memory: 20M
restart: always
ports:
- "${CURRENCY_SERVICE_PORT}"
environment:
Expand All @@ -155,6 +188,11 @@ services:
context: ./src/emailservice
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-emailservice
deploy:
resources:
limits:
memory: 100M
restart: always
ports:
- "${EMAIL_SERVICE_PORT}"
environment:
Expand All @@ -175,6 +213,11 @@ services:
dockerfile: ./src/frontend/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-frontend
deploy:
resources:
limits:
memory: 200M
restart: always
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
environment:
Expand Down Expand Up @@ -263,6 +306,11 @@ services:
dockerfile: ./src/paymentservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-paymentservice
deploy:
resources:
limits:
memory: 70M
restart: always
ports:
- "${PAYMENT_SERVICE_PORT}"
environment:
Expand All @@ -282,6 +330,11 @@ services:
dockerfile: ./src/productcatalogservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-productcatalogservice
deploy:
resources:
limits:
memory: 20M
restart: always
ports:
- "${PRODUCT_CATALOG_SERVICE_PORT}"
environment:
Expand All @@ -301,6 +354,11 @@ services:
dockerfile: ./src/quoteservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-quoteservice
deploy:
resources:
limits:
memory: 30M
restart: always
ports:
- "${QUOTE_SERVICE_PORT}"
environment:
Expand All @@ -325,6 +383,11 @@ services:
dockerfile: ./src/recommendationservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-recommendationservice
deploy:
resources:
limits:
memory: 500M # This is high to enable supporting the recommendationCache feature flag use case
restart: always
ports:
- "${RECOMMENDATION_SERVICE_PORT}"
depends_on:
Expand All @@ -351,6 +414,11 @@ services:
dockerfile: ./src/shippingservice/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-shippingservice
deploy:
resources:
limits:
memory: 20M
restart: always
ports:
- "${SHIPPING_SERVICE_PORT}"
environment:
Expand All @@ -370,6 +438,11 @@ services:
context: ./src/featureflagservice
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-featureflagservice
deploy:
resources:
limits:
memory: 160M
restart: always
ports:
- "${FEATURE_FLAG_SERVICE_PORT}:${FEATURE_FLAG_SERVICE_PORT}" # Feature Flag Service UI
- "${FEATURE_FLAG_GRPC_SERVICE_PORT}" # Feature Flag Service gRPC API
Expand All @@ -388,6 +461,11 @@ services:
ffs_postgres:
image: cimg/postgres:14.2
container_name: postgres
deploy:
resources:
limits:
memory: 120M
restart: always
environment:
- POSTGRES_USER=ffs
- POSTGRES_DB=ffs
Expand All @@ -408,6 +486,11 @@ services:
dockerfile: ./src/loadgenerator/Dockerfile
cache_from:
- ${IMAGE_NAME}:${IMAGE_VERSION}-loadgenerator
deploy:
resources:
limits:
memory: 120M
restart: always
ports:
- "${LOCUST_WEB_PORT}:${LOCUST_WEB_PORT}"
environment:
Expand Down