Skip to main content
Harbor’s parallel execution system allows you to run hundreds or thousands of trials simultaneously. This guide covers strategies for optimizing throughput, managing resources, and troubleshooting common issues.

Execution Architecture

Harbor uses an orchestrator pattern to manage parallel trial execution:
Each trial runs independently with its own:
  • Environment (container)
  • Agent instance
  • Verifier
  • Logs directory

Orchestrator Types

Local Orchestrator

Runs trials in parallel on your local machine using asyncio:
Best for:
  • Development and testing
  • Small to medium evaluations (1-50 concurrent trials)
  • Controlled resource usage
Configuration:

Choosing Concurrency Level

The optimal concurrency depends on several factors:

CPU-Bound Tasks

For tasks that use significant CPU:

Memory-Bound Tasks

Calculate based on available memory:

I/O-Bound Tasks

For tasks that wait on API calls or network:

Cloud Execution

Cloud providers handle resource management:

Retry Configuration

Configure automatic retries for transient failures:
config.json

Retry Strategies

Aggressive (retry everything):
Conservative (retry only network/provider errors):
No retries:

Resource Management

Monitoring Resource Usage

Docker Resource Limits

Set global Docker resource limits:
~/.docker/daemon.json
Restart Docker:

Disk Space Management

Large evaluations can consume significant disk space:

Task-Specific Resource Limits

Override default resources per task:
Overriding resources may disqualify results from benchmark leaderboards.

Optimizing Throughput

Pipeline Stages

Each trial goes through these stages:
  1. Environment Build (5s - 10min)
  2. Environment Start (2s - 30s)
  3. Agent Setup (10s - 2min)
  4. Agent Execution (1min - 1hr)
  5. Verification (10s - 5min)
  6. Cleanup (2s - 10s)

Reduce Build Time

Use pre-built images:
task.toml
Use Docker layer caching:
Use snapshots (cloud providers):

Reduce Startup Time

Minimize Dockerfile operations:

Batch Similar Tasks

Group tasks with similar environments:

Rate Limiting

LLM Provider Rate Limits

Stay within API rate limits:

Cloud Provider Rate Limits

Progress Monitoring

Real-time Progress

Harbor shows real-time progress by default:

Quiet Mode

For scripting or CI/CD:

Logging

Check orchestrator logs:

Debugging Parallel Execution

Common Issues

Too many concurrent trials:
Solution: Reduce --n-concurrent Rate limit errors:
Solution: Reduce concurrency or add retry delays Out of memory:
Solution: Reduce concurrency or increase system memory Out of disk space:
Solution: Clean up old jobs and Docker images

Debugging Individual Trials

When trials fail:

Performance Benchmarks

Local Execution (16-core, 64GB RAM)

Diminishing returns beyond 16 concurrent trials

Cloud Execution (Daytona)

Approximate values, varies by task complexity

Best Practices

  1. Start small: Test with 1-2 tasks before full evaluation
  2. Increase gradually: Double concurrency until you hit limits
  3. Monitor resources: Watch CPU, memory, and disk usage
  4. Use appropriate environment: Local for fewer than 50 tasks, cloud for more than 100
  5. Pre-build images: Use Docker layer caching and snapshots
  6. Set appropriate timeouts: Avoid wasting resources on stuck trials
  7. Enable retries: Handle transient failures automatically
  8. Clean up regularly: Remove old jobs and Docker artifacts
  9. Batch similar tasks: Group tasks with similar environments
  10. Test retry config: Ensure retries work as expected

Example Configurations

Small Evaluation (Local)

Medium Evaluation (Local)

Large Evaluation (Cloud)

Next Steps

Running Evaluations

Learn evaluation basics

Cloud Execution

Scale to cloud providers

Creating Tasks

Optimize tasks for parallel execution