Skip to content

feat: improve performance by introducing support for UDS#647

Closed
dyxushuai wants to merge 8 commits intorpcpool:masterfrom
dyxushuai:feat/uds
Closed

feat: improve performance by introducing support for UDS#647
dyxushuai wants to merge 8 commits intorpcpool:masterfrom
dyxushuai:feat/uds

Conversation

@dyxushuai
Copy link

@dyxushuai dyxushuai commented Dec 5, 2025

Unix Domain Socket (Only work in UNIX environment)

For local communication, UDS provides ~18-20% lower latency compared to TCP:

{
  "grpc": {
    "transport": "uds",
    "uds": {
      "socket_path": "/tmp/yellowstone-grpc.sock",
      "remove_on_startup": true
    }
  }
}

Client connection via UDS:

// Rust client
let client = GeyserGrpcClient::build_from_static("unix:///tmp/yellowstone-grpc.sock")?
    .connect()
    .await?;

Benchmark Results (TCP vs UDS)

Metric TCP UDS Improvement
Ping Latency 37.3 µs 30.6 µs 18% faster
Throughput 27.0 K/s 32.4 K/s 20% higher

Copilot AI review requested due to automatic review settings December 5, 2025 16:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Unix Domain Socket (UDS) transport support to the gRPC server, providing an ~18-20% performance improvement for local communication compared to TCP. The implementation maintains backward compatibility with existing TCP-based configurations.

Key changes:

  • Adds a configurable transport layer with support for both TCP (default) and UDS
  • Implements socket file management including cleanup and directory creation
  • Includes comprehensive benchmarks demonstrating the performance improvements

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
yellowstone-grpc-geyser/src/config.rs Adds TransportType enum and ConfigUds struct for transport configuration; makes address optional while maintaining backward compatibility
yellowstone-grpc-geyser/src/grpc.rs Implements UDS server binding logic with socket file handling; refactors server spawning into a macro to support both transport types
yellowstone-grpc-geyser/config.json Updates example config to show TCP transport configuration explicitly
yellowstone-grpc-geyser/config-uds.json Adds new example configuration for UDS transport
benches/transport.rs Adds performance benchmarks comparing TCP and UDS latency and throughput
benches/Cargo.toml Adds benchmark package with required dependencies
README.md Documents the new transport options with examples and benchmark results; fixes spacing in documentation
Cargo.toml Adds benchmark package to workspace and includes new dependencies
Cargo.lock Updates lock file with new dependencies for benchmarking

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@leafaar
Copy link
Contributor

leafaar commented Dec 6, 2025

Thank you very much for the contribution! I am taking a read.

@leafaar
Copy link
Contributor

leafaar commented Mar 7, 2026

I want to thank you for the PR again @dyxushuai. I will close this PR because we end up implementing ourselves, it was easier to iterate.

Here's the PR: #671

I know it's already merged but if you have any comments please let us know!

@leafaar leafaar closed this Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants