Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyu-ren authored Jul 9, 2022
1 parent afc16da commit 6774fbc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
## 使用C++开发RPC框架
RPC(**R**emote **P**rocedure **C**all)框架使得远端的一个进程可以调用远端另一个进程所提供的方法,是构建分布式系统的基础通信协议。本项目使用了C++开发了一个RPC框架所需要的各个模块。


###项目简介:
1. 使用Protobuf作为RPC框架的序列化/反序列化方案;
2. 使用自己实现的网络库(参考muduo)来开发网络通信模块,使RPC服务提供方支持高并发与多线程的RPC请求;网络库地址:https://github.com/shiyu-ren/mymuduo
3. 开发了线程安全的有锁/无锁队列,在此基础上构建了异步日志模块;
4. 使用了Zookeeper作为分布式RPC框架的服务注册中心,实现模块解耦合。

###测试:
做了简单的压测。思路是实现echoservice,然后客户端发送大量请求到echoservice,记录请求前的时间点到请求结束后时间点的差值。
在本人电脑上做本机测试(CPU i5-6200u, 内存8G),发送Request串长6字节,发送50000条数据,得到结果:
时长:1.401247
QPS: 35681.8



### RPC框架原理
#### 集群与分布式
假如我们现有一个数独求解服务器,包含了登录服务模块、计算求解模块与后台管理模块。开始时候数独求解服务器部署在单机上,但随着用户的增多与请求计算量的增多,单机环境撑不住高并发的要求了。这个时候集群与分布式的部署架构就可以起到作用了。
Expand Down

0 comments on commit 6774fbc

Please sign in to comment.