Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOLT 支持 Unix Domain Socket 的可行性和必要性 讨论 #110

Open
leizhiyuan opened this issue Oct 30, 2018 · 3 comments
Open

BOLT 支持 Unix Domain Socket 的可行性和必要性 讨论 #110

leizhiyuan opened this issue Oct 30, 2018 · 3 comments

Comments

@leizhiyuan
Copy link

leizhiyuan commented Oct 30, 2018

Your question

最近有用户提到,BOLT 是否可以支持 Unix 的进程间通信,提供类似同物理机上调用,或者进程间调用。来提供性能。 比如 mesh 的场景,我这边先粗劣改了几处来快速验证了下,基础的RPC 通信是 ok,如果要支持,这几处可能是需要抽象的。供后面参考。

https://github.com/leizhiyuan/sofa-bolt/tree/unix_socket

1.对 url 的抽象,这种情况,客户端 url 是空的
2.提供多个 RpcClient 和 RpcServer,因为有一些静态字段,或者一个,但是通过开关来控制
3.连接管理的一些地方。需要使用SocketAddress,但是带来的影响是一些本来从InetSocketAddress 取 url 的,就需要先转换,再处理。比如ResponseCommand中

Your scenes

describe your use scenes (why need this feature)

Your advice

describe the advice or solution you'd like

Environment

  • SOFABolt version:
  • JVM version (e.g. java -version):
  • OS version (e.g. uname -a):
  • Maven version:
  • IDE version:
@smalldok
Copy link

估计不太可能,你说的这些让我想到了ZeroMQ

@huangyunbin
Copy link

Unix Socket其实非常有必要的,特别是在容器的场景下。我们这边的 rpc框架就已经有Unix Socket的通信方式了。
@leizhiyuan的代码我还没仔细看,我先说下几个注意的点:
1 Unix Socket是不开端口的了,所以一些监控工具或者测试框架需要注意
2 Unix Socket是拿不到来源的ip了,很多场景其实都需要的。我们这边是在cookie中传输。
3 Unix Socket的sock文件放到/dev/shm是否能提高性能

@captainjack0x7C8
Copy link

ServiceMesh场景下UNIX域套接字很实用,但这样做,需要能够对请求进行路由,选择使用网络套接字或UNIX域套接字

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

No branches or pull requests

4 participants