Files
rustfs/.docker
houseme 27468ebfa9 feat(get): consolidate GET performance optimization (#3972)
* feat(get): consolidate GET performance optimization

Consolidated implementation of all GET performance optimizations into
a single, well-organized commit replacing the previous patch-on-patch
approach.

## Changes

### Configuration (set_disk/mod.rs)
- Consolidated all GET optimization flags into a single organized section
- Enabled by default: codec streaming, metadata early-stop, page cache reclaim
- Added codec streaming multipart flag (default: disabled)
- Added version-aware early-stop flag (default: disabled)
- Added adaptive duplex buffer sizing based on object size
- All flags use OnceLock caching with rollout percentage support

### Metadata Early-Stop (set_disk/read.rs)
- Delete marker early-stop when quorum agrees
- Version-aware early-stop for versioned GET requests
- MetadataQuorumAccumulator enhanced with:
  - delete_marker_votes tracking
  - requested_version_id and matching_version_votes tracking
  - version_early_stop_decision() method
- 6 new tests for version early-stop scenarios

### Codec Streaming (erasure/coding/decode_reader.rs)
- DualInFlight (2-stripe lookahead) enabled by default

### Decode Pipeline (erasure/coding/decode.rs)
- Stripe prefetch count configuration
- Bitrot-decode overlap configuration

### Disk Layer (disk/local.rs)
- O_DIRECT read configuration constants (preparation)

### Metrics (io-metrics/lib.rs)
- BytesPool acquisition/return metrics
- Metadata phase duration with early-stop label
- Total duration with reader_path label

### Diagnostics (diagnostics/)
- Early-stop reason constants
- Pool tier/outcome label constants

### Observability (.docker/observability/)
- 3 Grafana dashboards for GET optimization monitoring
- Prometheus alert rules (6 alerts: 3 critical, 3 warning)
- Updated README.md and README_ZH.md with usage docs

### Config (config/src/constants/runtime.rs)
- Page cache reclaim read enabled by default

## Environment Variables

| Variable | Default | Description |
|----------|---------|-------------|
| RUSTFS_GET_CODEC_STREAMING_ENABLE | true | Codec streaming base flag |
| RUSTFS_GET_CODEC_STREAMING_ROLLOUT_PCT | 100 | Codec streaming rollout % |
| RUSTFS_GET_CODEC_STREAMING_MULTIPART_ENABLE | false | Multipart codec streaming |
| RUSTFS_GET_METADATA_EARLY_STOP_ENABLE | true | Early-stop base flag |
| RUSTFS_GET_METADATA_EARLY_STOP_ROLLOUT_PCT | 100 | Early-stop rollout % |
| RUSTFS_GET_METADATA_VERSION_EARLY_STOP_ENABLE | false | Version-aware early-stop |
| RUSTFS_OBJECT_FILE_CACHE_RECLAIM_READ_ENABLE | true | Page cache reclaim |
| RUSTFS_OBJECT_DIRECT_IO_READ_ENABLE | false | O_DIRECT (preparation) |
| RUSTFS_GET_DECODE_STRIPE_PREFETCH_COUNT | 1 | Stripe prefetch |
| RUSTFS_GET_BITROT_DECODE_OVERLAP_ENABLE | false | Bitrot-decode overlap |
| RUSTFS_GET_CODEC_STREAMING_MAX_INFLIGHT | 2 | DualInFlight stripes |

## Rollback

All optimizations can be disabled via environment variables:
RUSTFS_GET_CODEC_STREAMING_ENABLE=false
RUSTFS_GET_METADATA_EARLY_STOP_ENABLE=false
RUSTFS_OBJECT_FILE_CACHE_RECLAIM_READ_ENABLE=false

Co-Authored-By: heihutu <heihutu@gmail.com>

* test(get): add stress test scripts for GET optimization validation

- quick-validate-get-optimization.sh: Quick 5-minute validation
- stress-test-get-optimization.sh: Full 30+ minute stress test
- README-stress-test.md: Usage documentation

Co-Authored-By: heihutu <heihutu@gmail.com>

* test(ecstore): align file cache reclaim defaults

* chore(deps): update redis and erasure codec

* test(ecstore): align decode fill policy default

* test(ecstore): align metadata early-stop default

* fix(ecstore): keep metadata early stop opt-in

---------

Co-authored-by: heihutu <heihutu@gmail.com>
2026-06-28 07:14:07 +08:00
..

RustFS Docker Infrastructure

This directory contains the complete Docker infrastructure for building, deploying, and monitoring RustFS. It provides ready-to-use configurations for development, testing, and production-grade observability.

📂 Directory Structure

Directory Description Status
observability/ [RECOMMENDED] Full-stack observability (Prometheus, Grafana, Tempo, Loki). Production-Ready
compose/ Specialized setups (e.g., 4-node distributed cluster testing). ⚠️ Testing Only
mqtt/ EMQX Broker configuration for MQTT integration testing. 🧪 Development
openobserve-otel/ Alternative lightweight observability stack using OpenObserve. 🔄 Alternative

📄 Root Directory Files

The following files in the project root are essential for Docker operations:

Build Scripts & Dockerfiles

File Description Usage
docker-buildx.sh Multi-Arch Build Script
Automates building and pushing Docker images for amd64 and arm64. Supports release and dev channels.
./docker-buildx.sh --push
Dockerfile Production Image (Alpine)
Lightweight image using musl libc. Downloads pre-built binaries from GitHub Releases.
docker build -t rustfs:latest .
Dockerfile.glibc Production Image (Ubuntu)
Standard image using glibc. Useful if you need specific dynamic libraries.
docker build -f Dockerfile.glibc .
Dockerfile.source Development Image
Builds RustFS from source code. Includes build tools. Ideal for local development and CI.
docker build -f Dockerfile.source .

Docker Compose Configurations

File Description Usage
docker-compose.yml Main Development Setup
Comprehensive setup with profiles for development, observability, and proxying.
docker compose up -d
docker compose --profile observability up -d
docker-compose-simple.yml Quick Start Setup
Minimal configuration running a single RustFS instance with 4 volumes. Perfect for first-time users.
docker compose -f docker-compose-simple.yml up -d

Located in: .docker/observability/

We provide a comprehensive, industry-standard observability stack designed for deep insights into RustFS performance. This is the recommended setup for both development and production monitoring.

Components

  • Metrics: Prometheus (Collection) + Grafana (Visualization)
  • Traces: Tempo (Storage) + Jaeger (UI)
  • Logs: Loki
  • Ingestion: OpenTelemetry Collector

Key Features

  • Full Persistence: All metrics, logs, and traces are saved to Docker volumes, ensuring no data loss on restarts.
  • Correlation: Seamlessly jump between Logs, Traces, and Metrics in Grafana.
  • High Performance: Optimized configurations for batching, compression, and memory management.

Quick Start

cd .docker/observability
docker compose up -d

🧪 Specialized Environments

Located in: .docker/compose/

These configurations are tailored for specific testing scenarios that require complex topologies.

Distributed Cluster (4-Nodes)

Simulates a real-world distributed environment with 4 RustFS nodes running locally.

docker compose -f .docker/compose/docker-compose.cluster.yaml up -d

Integrated Observability Test

A self-contained environment running 4 RustFS nodes alongside the full observability stack. Useful for end-to-end testing of telemetry.

docker compose -f .docker/compose/docker-compose.observability.yaml up -d

📡 MQTT Integration

Located in: .docker/mqtt/

Provides an EMQX broker for testing RustFS MQTT features.

Quick Start

cd .docker/mqtt
docker compose up -d

👁️ Alternative: OpenObserve

Located in: .docker/openobserve-otel/

For users preferring a lightweight, all-in-one solution, we support OpenObserve. It combines logs, metrics, and traces into a single binary and UI.

Quick Start

cd .docker/openobserve-otel
docker compose up -d

🔧 Common Operations

Cleaning Up

To stop all containers and remove volumes (WARNING: deletes all persisted data):

docker compose down -v

Viewing Logs

To follow logs for a specific service:

docker compose logs -f [service_name]

Checking Status

To see the status of all running containers:

docker compose ps