DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • From Load Testing to Performance Engineering: Why the Shift Matters
  • Rust, WASM, and Edge: Next-Level Performance
  • Rust and WebAssembly: Unlocking High-Performance Web Apps
  • Rust vs Python: Differences and Ideal Use Cases

Trending

  • Build Self-Managing Data Pipelines With an LLM Agent
  • Scaling Cloud Data Automation: A Practical Guide to Open Table Formats
  • Detecting Bugs and Vulnerabilities in Java With SonarQube
  • From Data Movement to Local Intelligence: The Shift from Centralized to Federated AI
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Testing, Tools, and Frameworks
  4. Hurley: A High-Performance HTTP Client and Load Testing Tool Engineered in Rust

Hurley: A High-Performance HTTP Client and Load Testing Tool Engineered in Rust

Technical architecture, capabilities, and use cases of hurley, a project developed in Rust that functions as a general-purpose HTTP client and a performance testing tool.

By 
Dursun Koç user avatar
Dursun Koç
DZone Core CORE ·
Feb. 20, 26 · Analysis
Likes (0)
Comment
Save
Tweet
Share
1.7K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction and Motivation

This article examines the technical architecture, capabilities, and use cases of hurley, a project developed in Rust that functions as both a general-purpose HTTP client and a performance testing tool. It explores the efficiency advantages gained by managing API testing and performance analysis through a unified tool within software development processes.

With the proliferation of microservices architectures and distributed systems, communication via the HTTP protocol has become the lifeblood of the software ecosystem. In this context, developers face two fundamental needs: (1) A flexible HTTP client to verify the functional correctness of API endpoints, and (2) Performance testing tools to analyze system behavior under load.

Typically, distinct toolsets are employed for these two requirements (specialized HTTP clients vs. load testing tools like `wrk` or `Apache Benchmark`). hurley aims to minimize context switching in development and testing processes and offer a unified testing experience by consolidating these two functions into a single command-line interface (CLI).

Core Capabilities and HTTP Client Mode

hurley features a client mode that demonstrates full compliance with modern HTTP standards. It supports all fundamental operations required by RESTful architectures.

1. Protocol Support and Request Structure

The tool supports all standard HTTP methods (GET, POST, PUT, DELETE, PATCH, HEAD). Request configuration can be flexibly structured via command-line arguments:

  • Header management: Defining custom HTTP headers using the -H parameter.
  • Payload management: Inline data submission via the -d parameter or file-based data streaming via the -f parameter.
  • Redirect policies: Automatic tracking of HTTP 3xx series responses using the -L parameter.
Shell
 
# Example: POST request containing custom headers and payload
hurley -X POST https://api.example.com/v1/resource \\
  -H "Content-Type: application/json" \\
  -H "X-Client-ID: system-a" \\
  -d '{"key": "value", "timestamp": 1678900000}'


Performance Testing and Load Simulation

A distinguishing feature of the tool is its ability to instantaneously transform existing HTTP requests into a load test without requiring external configuration.

1. Concurrency Model

hurley is built upon Rust’s `Tokio` asynchronous runtime. This architecture allows for the management of a high number of concurrent connections while utilizing system resources (CPU and Memory) at minimal levels. The intensity of the test scenario is determined by the -c (concurrency) and -n (total requests) parameters.

2. Dataset-Based Stochastic Testing

To simulate real-world traffic patterns, hurley supports non-deterministic test scenarios. Through a dataset defined in JSON format, requests with different endpoints, methods, and payloads can be distributed randomly or sequentially. This approach is critical for eliminating the misleading effects of cache mechanisms (cache warming bias) and measuring the general stability of the system.

JSON
 
/* Example Dataset Schema */
[
  { "method": "GET", "path": "/api/users/101" },
  { "method": "POST", "path": "/api/orders", "body": { "id": 55, "item": "A-1" } }
]


Performance Metrics and Statistical Analysis

In reporting test results, the tool goes beyond average values to present statistical distribution analyses. Percentile metrics are vital for detecting tail latency.

The fundamental metrics reported include:

  • Throughput: The number of requests processed per second (RPS).
  • Latency distribution:
    • P50 (Median): The completion time for 50% of requests.
    • P95 and P99: System performance in the slowest 5% and 1% segments. These values are critical indicators for Service Level Agreement (SLA) compliance.
    • Jitter: The standard deviation and range of variation in response times.
Shell
 
 Statistical Summary
   Total Requests:      1000
   Error Rate:          0.00%
   Requests/sec:        450.25

 Latency Distribution (Percentiles)
   p50 (Median):        45.12 ms
   p95:                120.45 ms
   p99:                210.88 ms


Technical Architecture

The project is constructed upon the performance and reliability-oriented libraries of the Rust ecosystem:

  • Asynchronous I/O: Non-blocking I/O operations via `tokio` and `reqwest` libraries.
  • Statistical computation: High dynamic range histogram analysis via the `hdrhistogram` library.
  • Error management: Deterministic management of runtime errors via a strong type system and the `thiserror` library.

These architectural choices ensure that the tool delivers performance at the C/C++ level without compromising memory safety.

Installation

hurley can be installed via Cargo, Rust’s package manager, or built from source.

Via Cargo (Recommended):

Shell
 
cargo install hurley


From Source:

Shell
 
git clone https://github.com/dursunkoc/hurley.git
cd hurley
cargo build --release


The binary will be available at `target/release/hurley.`

Conclusion

The project continues to be developed as open source, with plans to add features such as distributed testing capabilities and HTTP/3 support to the roadmap.

Project source code: https://github.com/dursunkoc/hurley

Load testing Rust (programming language) Performance

Published at DZone with permission of Dursun Koç. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • From Load Testing to Performance Engineering: Why the Shift Matters
  • Rust, WASM, and Edge: Next-Level Performance
  • Rust and WebAssembly: Unlocking High-Performance Web Apps
  • Rust vs Python: Differences and Ideal Use Cases

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook