Content-Length: 353005 | pFad | http://github.com/importcpp/WebServer/commit/c8bea3276d7628ac57e0c59addd061919029007a

C2 update ReadMe · importcpp/WebServer@c8bea32 · GitHub
Skip to content

Commit c8bea32

Browse files
committed
update ReadMe
1 parent 51e5e38 commit c8bea32

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

History.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
版本一的框架如下图所示:
88

9-
<img src="https://github.com/importcpp/httpServer/raw/master/file/serverarch1.png" alt="v1" style="zoom: 45%;" />
10-
11-
### Http version 2
9+
### ![img](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/serverarch1.png)Http version 2
1210

1311
这里每次有新任务到达时,就将新任务转交给线程,然后把程序的控制权转交到Epoll上,但是当在高并发状态,连接数太高,就会有很多活动的事件fd, 这是频繁的转交线程也会造成很大的开销
1412

@@ -25,15 +23,15 @@
2523

2624
此时的框架图如下图所示:
2725

28-
<img src="https://github.com/importcpp/httpServer/raw/master/file/serverarch2_0.png" alt="v2" style="zoom:45%;" />
26+
![img](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/serverarch2_0.png)
2927

3028
但是直接这样就 单个线程负责多个文件描述符 是不现实的,比如,A线程负责了 a3和a4两个文件描述符,如果主线程应该如何通知 A线程 去处理 a3和a4两个活动fd呢,这里虽然可以想办法实现(将发生活动事件的fd 作为数据写入eventfd,然后再唤醒线程),但是有没有更好的办法呢。
3129

3230
进一步的思考时 如何让单个线程彻头彻尾的负责多个文件描述符,彻尾很简单,负责文件描述符的close即可。彻头就是要去负责监视文件描述符的活动事件,也就是由主线程通知A线程,你应该负责a3 这个文件描述符,A线程中也应该创建epoll对象,将a3需要监听的事件加入进来。往后,可继续添加多个文件描述符。 其实这一步相当于对之前的思路做了一个调整,之前是想让主线程去监听所有事件,现在主线程只负责accept请求,然后将accept的对象的控制权转交给其余线程,至此,版本二的设想已经基本完成
3331

3432
版本二的基本框架如下图所示:
3533

36-
<img src="https://github.com/importcpp/httpServer/raw/master/file/serverarch2.png" alt="v3" style="zoom: 80%;" />
34+
![img](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/serverarch2.png)
3735

3836
为了简化处理,接下来的版本V2_1 将完成单线程的http server
3937

README.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050

5151
本服务器采用了事件循环 + 非阻塞IO的主题架构,通过事件驱动和事件回调来实现业务逻辑。事件循环用于做事件通知,如果有新的连接被Accept,则把新连接的socket对象的管理工作转交给其他线程。模型的整体架构如下图所示,模型的架构发展过程可见[History](https://github.com/importcpp/WebServer/blob/master/History.md).
5252

53-
<img src="https://gitee.com/realgeorge/FIleForGithub/blob/master/file/serverarch2.png" alt="v3" style="zoom: 80%;" />
53+
![模型架构](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/serverarch2.png)
5454

5555
## Server Performance
5656

@@ -71,13 +71,11 @@
7171

7272
* My Webserver 响应消息体为短字符串时测试结果
7373

74-
![mine_qps](https://github.com/importcpp/WebServer/raw/master/file/mine_qps.png)
74+
![自己服务器的QPS数据](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/mine_qps.png)
7575

7676
* Muduo 响应消息体为短字符串时测试结果
7777

78-
![muduo_qps](https://github.com/importcpp/WebServer/raw/master/file/muduo_qps.png)
79-
80-
78+
![Muduo的QPS数据](https://gitee.com/realgeorge/FIleForGithub/raw/master/file/muduo_qps.png)
8179

8280
### Analysis
8381

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/importcpp/WebServer/commit/c8bea3276d7628ac57e0c59addd061919029007a

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy