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

chapter 02: resource limits for grocery-store and inventory too stringent #19

Closed
fabricev opened this issue Jul 7, 2022 · 2 comments
Closed

Comments

@fabricev
Copy link

fabricev commented Jul 7, 2022

Both containers start and stop.

Had to raise the memory limit (set at 50M) to 80M to have them running. Below is a docker stats view to show the actual usage is above the limits set in the docker-compose.yml

CONTAINER ID   NAME                      CPU %     MEM USAGE / LIMIT     MEM %     NET I/O           BLOCK I/O        PIDS
7afa474a8f1b   shopper                   0.69%     32.3MiB / 30.76GiB    0.10%     59.4kB / 106kB    0B / 360kB       8
b6fe39fa5ef5   grocery-store             4.28%     66.84MiB / 80MiB      83.55%    104kB / 153kB     0B / 381kB       17
c414d81d1f71   inventory                 4.45%     60.35MiB / 80MiB      75.44%    65.9kB / 97.6kB   0B / 385kB       17
6e0675111661   opentelemetry-collector   0.56%     42.8MiB / 30.76GiB    0.14%     743kB / 977kB     946kB / 0B       21
2325027f0e93   promtail                  0.90%     18.57MiB / 30.76GiB   0.06%     14.6kB / 35.7kB   209kB / 102kB    21
d24b5a7fc636   prometheus                0.00%     31.75MiB / 30.76GiB   0.10%     233kB / 1.98MB    807kB / 266kB    21
dcf11c6fe1f5   loki                      0.34%     23.09MiB / 30.76GiB   0.07%     163kB / 23.9kB    287kB / 49.2kB   20
3ba52c18e8da   jaeger                    0.22%     16.91MiB / 30.76GiB   0.05%     604kB / 1.5MB     20.5kB / 0B      21
6a9886319e0c   grafana                   0.06%     27.5MiB / 30.76GiB    0.09%     22.8kB / 4.62kB   426kB / 184kB    21
@fabricev
Copy link
Author

fabricev commented Jul 7, 2022

Modified docker-compose.yml

version: "3.7"
services:
  shopper:
    image: codeboten/shopper:chapter2
    container_name: shopper
    environment:
      - OTEL_EXPORTER_OTLP_ENDPOINT=opentelemetry-collector:4317
      - OTEL_EXPORTER_OTLP_INSECURE=true
      - GROCERY_STORE_URL=http://grocery-store:5000/products
    networks:
      - cloud-native-observability
    depends_on:
      - grocery-store
      - opentelemetry-collector
    stop_grace_period: 100ms
  grocery-store:
    image: codeboten/grocery-store:chapter2
    container_name: grocery-store
    environment:
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://opentelemetry-collector:4317
      - OTEL_SERVICE_NAME=grocery-store
      - INVENTORY_URL=http://legacy-inventory:5001/inventory
    networks:
      - cloud-native-observability
    depends_on:
      - legacy-inventory
      - opentelemetry-collector
    stop_grace_period: 100ms
    ports:
      - 5000:5000
    deploy:
      resources:
        limits:
          cpus: "0.50"
          memory: 80M
  legacy-inventory:
    image: codeboten/legacy-inventory:chapter2
    container_name: inventory
    environment:
      - OTEL_EXPORTER_OTLP_ENDPOINT=http://opentelemetry-collector:4317
      - OTEL_SERVICE_NAME=inventory
    networks:
      - cloud-native-observability
    depends_on:
      - opentelemetry-collector
    stop_grace_period: 100ms
    ports:
      - 5001:5001
    deploy:
      resources:
        limits:
          cpus: "0.50"
          memory: 80M
  jaeger:
    image: jaegertracing/all-in-one:1.29.0
    container_name: jaeger
    ports:
      - 6831:6831/udp
      - 16686:16686
    networks:
      - cloud-native-observability
  prometheus:
    image: prom/prometheus:v2.29.2
    container_name: prometheus
    volumes:
      - ./config/prometheus/config.yml/:/etc/prometheus/prometheus.yml
    command:
      - "--config.file=/etc/prometheus/prometheus.yml"
      - "--enable-feature=exemplar-storage"
    ports:
      - 9090:9090
    networks:
      - cloud-native-observability
  opentelemetry-collector:
    image: otel/opentelemetry-collector-contrib:0.43.0
    container_name: opentelemetry-collector
    volumes:
      - ./config/collector/config.yml/:/etc/opentelemetry-collector.yml
      - /var/run/docker.sock:/var/run/docker.sock
    command:
      - "--config=/etc/opentelemetry-collector.yml"
    networks:
      - cloud-native-observability
    ports:
      - 4317:4317
      - 13133:13133
      - 8889:8889
    stop_grace_period: 100ms
  loki:
    image: grafana/loki:2.3.0
    container_name: loki
    ports:
      - 3100:3100
    command: -config.file=/etc/loki/local-config.yaml
    networks:
      - cloud-native-observability
  promtail:
    image: grafana/promtail:2.3.0
    container_name: promtail
    volumes:
      - /var/log:/var/log
    command: -config.file=/etc/promtail/config.yml
    networks:
      - cloud-native-observability
  grafana:
    image: grafana/grafana:8.3.3
    container_name: grafana
    ports:
      - 3000:3000
    volumes:
      - ./config/grafana/provisioning:/etc/grafana/provisioning
    networks:
      - cloud-native-observability
    environment:
      - GF_AUTH_ANONYMOUS_ENABLED=true
      - GF_AUTH_ORG_ROLE=Editor
      - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
      - GF_AUTH_DISABLE_LOGIN_FORM=true

networks:
  cloud-native-observability:

@codeboten
Copy link
Collaborator

Thanks for reporting this! I've updated the memory requirement as per your suggestion ba776b7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants