C++并发服务器avant 支持http、tcp protobuf、websocket,linux开源框架 零依赖轻松编译部署 Reactor

开源地址: https://github.com/mfavant/avant
Github:https://github.com/mfavant/avant
诚招有兴趣的小伙伴加入开发维护

Avant

Network Message Framework For Linux C++.

cpp-min: C++17
os: linux
protocol: http tcp stream(protobuf) websocket
tls/ssl: openssl
script: lua

Get Start

If there are already dependencies to be installed on the host, please selectively ignore them.

Ubuntu (Docker)

$ docker run -it ubuntu
$ sudo apt-get update
$ sudo apt-get install apt-utils -y
$ sudo apt-get install cmake g++ make git -y
$ sudo apt-get install protobuf-compiler libprotobuf-dev -y
$ sudo apt-get install libssl-dev -y
$ git clone https://github.com/crust-hub/avant.git
$ cd avant
$ cd protocol
$ make
$ cd ..
$ cmake .
$ make -j4

CentOS8 (Docker)

centos8

Config File

$ sudo mkdir /avant_static
$ vim bin/config/main.ini

Avant Start

$ cd bin
$ ./avant
$ ps -ef | grep avant

Avant Safe Stop

$ ps -ef | grep avant
$ kill PID

Example

$ docker run -it --privileged -p 20023:20023 -v ${LOCAL_HTTP_DIR_PATH}:/avant_static gaowanlu/avant:latest bash
$ cd ./bin
$ ./avant

APP Example

support tcp keep-alive stream (protobuf) and http app (http-parser)、websocket

  1. framework config
  2. stream protobuf app
  3. http app
  4. websocket app

QPS

CPU: Intel® Core™ i5-9600KF CPU @ 3.70 GHz
OS : WSL2 Ubuntu Mem 8GB (Windows 11)

config/main.ini 
    worker_cnt:8  
    max_client_cnt:10000  
    accept_per_tick: 100  

wrk testing, avant http

# avant
$ wrk -c {{connection_num}} -t {{threads}} http://IP:20023/
$ wrk -c {{connection_num}} -t {{threads}} -d60s --header "Connection: keep-alive" http://127.0.0.1:20023/

Third-Party

1、@http-parser 2、@lua
3、@protobuffer 4、@openssl
5、@zlib

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

高万禄

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值