run-badger-benchmark.sh raw

   1  #!/bin/bash
   2  # Run Badger benchmark with reduced cache sizes to avoid OOM
   3  
   4  # Set reasonable cache sizes for benchmark
   5  export ORLY_DB_BLOCK_CACHE_MB=256   # Reduced from 1024MB
   6  export ORLY_DB_INDEX_CACHE_MB=128   # Reduced from 512MB
   7  export ORLY_QUERY_CACHE_SIZE_MB=128 # Reduced from 512MB
   8  
   9  # Clean up old data
  10  rm -rf /tmp/benchmark_db_badger
  11  
  12  echo "Running Badger benchmark with reduced cache sizes:"
  13  echo "  Block Cache: ${ORLY_DB_BLOCK_CACHE_MB}MB"
  14  echo "  Index Cache: ${ORLY_DB_INDEX_CACHE_MB}MB"
  15  echo "  Query Cache: ${ORLY_QUERY_CACHE_SIZE_MB}MB"
  16  echo ""
  17  
  18  # Run benchmark
  19  ./benchmark -events "${1:-1000}" -workers "${2:-4}" -datadir /tmp/benchmark_db_badger
  20