docker-compose.profile.yml raw

   1  version: "3.8"
   2  
   3  services:
   4    # Next.orly.dev relay with profiling enabled
   5    next-orly:
   6      build:
   7        context: ../..
   8        dockerfile: cmd/benchmark/Dockerfile.next-orly
   9      container_name: benchmark-next-orly-profile
  10      environment:
  11        - ORLY_DATA_DIR=/data
  12        - ORLY_LISTEN=0.0.0.0
  13        - ORLY_PORT=8080
  14        - ORLY_LOG_LEVEL=info
  15        - ORLY_PPROF=cpu
  16        - ORLY_PPROF_HTTP=true
  17        - ORLY_PPROF_PATH=/profiles
  18        - ORLY_DB_BLOCK_CACHE_MB=512
  19        - ORLY_DB_INDEX_CACHE_MB=256
  20      volumes:
  21        - ./data/next-orly:/data
  22        - ./profiles:/profiles
  23      ports:
  24        - "8001:8080"
  25        - "6060:6060"  # pprof HTTP endpoint
  26      networks:
  27        - benchmark-net
  28      healthcheck:
  29        test: ["CMD", "curl", "-f", "http://localhost:8080/"]
  30        interval: 10s
  31        timeout: 5s
  32        retries: 5
  33        start_period: 60s  # Longer startup period
  34  
  35    # Benchmark runner - only test next-orly
  36    benchmark-runner:
  37      build:
  38        context: ../..
  39        dockerfile: cmd/benchmark/Dockerfile.benchmark
  40      container_name: benchmark-runner-profile
  41      depends_on:
  42        next-orly:
  43          condition: service_healthy
  44      environment:
  45        - BENCHMARK_TARGETS=next-orly:8080
  46        - BENCHMARK_EVENTS=50000
  47        - BENCHMARK_WORKERS=24
  48        - BENCHMARK_DURATION=60s
  49      volumes:
  50        - ./reports:/reports
  51      networks:
  52        - benchmark-net
  53      command: >
  54        sh -c "
  55          echo 'Waiting for ORLY to be ready (healthcheck)...' &&
  56          sleep 5 &&
  57          echo 'Starting benchmark tests...' &&
  58          /app/benchmark-runner --output-dir=/reports &&
  59          echo 'Benchmark complete - triggering shutdown...' &&
  60          exit 0
  61        "
  62  
  63  networks:
  64    benchmark-net:
  65      driver: bridge
  66