Skip to content

opencomputeproject/redfish-benchmark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redfish Benchmark

A comprehensive benchmarking tool for measuring and comparing the performance characteristics of HTTP/1.1, HTTP/2, and gRPC protocols when serving Redfish management API resources. This project provides both client and server implementations with integrated OpenTelemetry observability for detailed performance analysis and metrics collection.

Acknowledgements

This code was developed at HPE by Bailey Hollis during his internship.

Features

Benchmarking Capabilities

  • Multiple Protocol Support: Test HTTP/1.1, HTTP/2, and gRPC performance
  • Concurrent Testing: Configurable number of client threads
  • Flexible Test Parameters: Support for iteration-based and time-based benchmarks
  • TLS/HTTPS Support: Optional encryption for realistic production testing

Observability

  • OpenTelemetry Integration: Standard submission for easy analysis
  • Custom Instrumentation: Detailed timing for marshalling, network, and processing operations
  • Performance Metrics: Request counts, latencies, process statistics

Project Structure

redfish-benchmark/
├── src/
|    ├── benchmark/      # Main benchmark application, build target
|    ├── Redfish/        # Supporting library, compiled Redfish Protobuf Definitions
|    ├── GenericRPC/     # Supporting library, generic Protobuf Definition
|    ├── grpc-go/        # Supporting library, patched version of grpc-go (submodule)
|    └── protobuf-go/    # Supporting library, patched version of protobuf-go (submodule, unused)
├── mockups/    # Redfish JSON mockups (currently unused)
└── certs/      # Certificate storage for TLS/HTTPS

File Descriptions

Core Application Files (src/benchmark/)

  • main.go - Entry point and command-line argument parsing. Coordinates between client/server modes and protocol selection.

  • restServer.go - HTTP/REST server implementation supporting both HTTP/1.1 and HTTP/2. Uses Golang encoding/json to marshal objects into JSON.

  • restClient.go - HTTP/REST client implementation for benchmarking. Supports configurable thread counts, request patterns, and both iteration-based and duration-based testing. Uses encoding/json to unmarshal JSON into Go object.

  • grpcServer.go - gRPC server implementation using Protocol Buffers. Provides a generic resource service for serving "any" Redfish resource type.

  • grpcClient.go - gRPC client implementation for performance testing. Supports configurable thread counts, request patterns, and both iteration-based and duration-based testing.

  • demoObjects.go - Defines demo Redfish objects and resources used for benchmarking. Contains several predefined objects, of varying sizes.

  • otel.go - OpenTelemetry SDK initialization and configuration utilities. Sets up tracing, metrics collection, and exporters for performance monitoring.

  • otel_codec.go - Custom OpenTelemetry-instrumented Protocol Buffer codec for gRPC. Adds timing instrumentation to marshalling/unmarshalling operations. Requires patched grpc-go library to compile.

Configuration and Setup

  • go.mod - Go module definition with dependencies for gRPC, OpenTelemetry, and HTTP/2 support.

  • generate_certs.sh - Script to generate self-signed TLS certificates for HTTPS/TLS testing.

  • grpc-go/ - Local grpc-go library submodule with custom modifications for enhanced context support.

  • ctxpatch.patch - Critical patch file for grpc-go that adds context parameter support to codec interfaces, enabling context-aware marshalling and unmarshalling operations required for OpenTelemetry instrumentation.

Protocol Definitions

  • src/GenericRPC/Generic_service.proto - Generic gRPC service definition to allow the request of any Redfish resource type, using Protocol Buffer Any types.

Usage Examples

Server Mode

# Start HTTP/2 server with HTTPS
./redfish-benchmark \
-role=server \
-otel_endpoint="{ip}:4317" \
-cert_dir="./certs" \
-protocol=http2 \
-https=true \
-debug=false

# Start gRPC server
./redfish-benchmark \
-role=server \
-otel_endpoint="{ip}:4317" \
-cert_dir="./certs" \
-protocol=gRPC \
-https=false \
-debug=false

Client Mode

# HTTP/1.1 benchmark with 24 threads for 30 seconds
./redfish-benchmark \
-role=client \
-otel_endpoint="{ip}:4317" \
-protocol=http1 \
-debug=false \
-client_threads=24 \
-client_duration=30s \
-target="http://{ip}:8080/redfish/v1/AccountService" # Example

# gRPC benchmark with 24 threads and 100 iterations per thread
./redfish-benchmark \
-role=client \
-otel_endpoint="{ip}:4317" \
-cert_dir="./certs" \
-protocol=gRPC \
-https=true \
-debug=false \
-client_threads=24 \
-client_iterations=100 \
-target="{ip}:8080" \
-resource_type="/redfish/v1/AccountService" # Example

Dependencies

System Requirements

  • Go 1.24.3 or later
  • OpenSSL (for certificate generation)
  • Linux with network namespace support (for isolated testing)

Custom Modifications

This project includes a locally modified version of grpc-go as a submodule with an important patch (ctxpatch.patch) that adds context parameter support to codec interfaces. This modification is essential for the OpenTelemetry-instrumented Protocol Buffer codec implementation that enables detailed performance measurement of marshalling and unmarshalling operations.

Building

Protocol Buffer Generation

To regenerate the Go files from the Protocol Buffer definition:

# Generate Go code from the Generic service proto file
protoc --go_out=. --go-grpc_out=. src/Generic/Generic_service.proto

This command will generate:

  • src/GenericRPC/Generic_service.pb.go - Protocol Buffer message definitions
  • src/GenericRPC/Generic_service_grpc.pb.go - gRPC service definitions

Application Build

# Build the benchmark application
cd src/benchmark
go build .

About

Benchmarking REST & gRPC in a Redfish environment as presented at OCP GS 25

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages