feat: improve performance by introducing support for UDS#647
feat: improve performance by introducing support for UDS#647dyxushuai wants to merge 8 commits intorpcpool:masterfrom
Conversation
There was a problem hiding this comment.
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.
|
Thank you very much for the contribution! I am taking a read. |
|
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! |
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:
Benchmark Results (TCP vs UDS)