Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Erlang
  3. gen_rpc

gen_rpc

Apache-2.0Erlang2.0.0

A scalable RPC library for Erlang-VM languages using a mailbox-per-node architecture to avoid distributed port congestion.

GitHubGitHub
227 stars87 forks0 contributors

What is gen_rpc?

gen_rpc is a scalable remote procedure call library for Erlang and Elixir applications running on the Erlang Virtual Machine. It solves performance issues in high-traffic distributed systems by using a mailbox-per-node architecture and dedicated TCP connections, preventing bottlenecks in the standard `rpc` library and distributed Erlang ports. The library supports both plain TCP and SSL for secure communication, module version control, and integration with external discovery services.

Target Audience

Erlang and Elixir developers building distributed systems that require high-throughput, low-latency remote procedure calls across multiple nodes, especially in production environments with significant inter-node traffic.

Value Proposition

Developers choose gen_rpc over the standard `rpc` library because it eliminates scalability limits by avoiding single-mailbox bottlenecks and distributed port congestion, supports secure SSL communication for global deployments, and offers fine-grained configuration for timeouts and connection management while maintaining full API compatibility.

Overview

A scalable RPC library for Erlang-VM based languages

Use Cases

Best For

  • High-throughput microservices communication in Erlang/Elixir clusters
  • Building globally distributed Erlang/Elixir systems over the internet with SSL
  • Applications requiring module version-aware remote execution
  • Systems needing per-node connection sharding for load distribution
  • Production environments with over 150,000 RPC calls per second per node
  • Integrating with external service discovery systems like etcd for node management

Not Ideal For

  • Applications that heavily rely on shipping anonymous functions over RPC, as gen_rpc inherits the same limitation from Erlang's standard libraries.
  • Small-scale prototypes or low-traffic systems where the built-in `rpc` module's simplicity outweighs the need for gen_rpc's scalability features.
  • Environments where minimizing external dependencies is critical, as gen_rpc requires hut for logging and detailed SSL configuration.
  • Projects exclusively using Erlang's native distributed node management without the need for external discovery services like etcd.

Pros & Cons

Pros

Scalable Architecture

Implements a mailbox-per-node design with dedicated TCP connections per node, preventing mailbox flooding and distributed port congestion as detailed in the Rationale section, enabling high throughput.

API Compatibility

Maintains 100% compatibility with the standard `rpc` library's function interface and return values, making migration straightforward without code changes, as stated in the API section.

Secure SSL Support

Provides opinionated, secure SSL defaults with PFS ciphers and CN verification, allowing secure communication over insecure channels for globally distributed systems, as explained in the SSL Configuration.

Fine-Grained Control

Offers configurable timeouts for authentication, connection, transmission, and inactivity, optimizing resource usage in production environments, as listed in the Application settings.

Cons

Anonymous Function Limitation

Cannot execute anonymous functions shipped over RPC due to Erlang's implementation, a known issue that also affects the standard `rpc` library, limiting certain dynamic use cases.

Configuration Overhead

Requires complex setup for SSL certificates, timeouts, and external discovery, which can be daunting for simple deployments compared to the plug-and-play nature of the built-in `rpc`.

External Logging Dependency

Relies on the hut library for logging, adding an extra dependency and configuration step, whereas native Erlang logging might be simpler for some teams.

Frequently Asked Questions

Quick Stats

Stars227
Forks87
Contributors0
Open Issues4
Last commit6 months ago
CreatedSince 2015

Tags

#elixir#tcp#distributed-systems#erlang-vm#ssl#erlang#message-passing#concurrency#rpc#scalability

Built With

E
Erlang/OTP
r
rebar3
g
gen_tcp
D
Docker

Included in

Erlang1.7k
Auto-fetched 1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub