-
Notifications
You must be signed in to change notification settings - Fork 38
Description
Currently, SLIM nodes communicate via gRPC over TCP sockets, using localhost for local connections. While this approach works well for remote clients, it is not optimal when multiple agents run on the same host. In such cases, we can improve efficiency by switching to gRPC over Unix domain sockets for local communication.
Advantages of Using Unix Sockets over TCP/localhost:
-
Lower Latency and Overhead:
Unix sockets avoid the network stack, resulting in faster data transfer and reduced CPU usage compared to TCP, even when using localhost. -
Improved Security:
Unix sockets can leverage filesystem permissions for access control, restricting which processes can connect, and reducing the attack surface compared to TCP ports. -
Resource Efficiency:
Unix sockets use fewer system resources and file descriptors than TCP sockets, which is especially beneficial when managing many concurrent local connections. -
No Network Configuration Needed:
Unix sockets do not require IP addresses or open ports, simplifying deployment and minimizing potential network conflicts on the host.
Switching to gRPC over Unix domain sockets for intra-host communication will enhance performance, security, and scalability when running multiple SLIM agents locally.
Reference example: https://github.com/hyperium/tonic/tree/master/examples/src/uds
Metadata
Metadata
Assignees
Labels
Type
Projects
Status