Skip to content

A webserver developed using modern c++

License

Notifications You must be signed in to change notification settings

Gusiil/HttpServer

 
 

Repository files navigation

HttpServer

A webserver developed using modern c++

License

Introduction

该项目参考muduo实现了一个多线程静态的web服务器。HttpServer使用c++11实现,支持head、post和get请求,使用
epoll ET边沿触发提高实时性。HttpServer支持短连接、长连接,和采用timerfd实现的应用层心跳。

Environment

Ubuntu 16.04, i5-8G
gcc-5.4, g++-5.4

Usage

  • 编译
    make -j4
    cd webbench && make
  • 运行
    ./run.sh
    ./webbench.sh

Architecture

该项目采用reactor+NIO+thread pool+epoll ET的模型设计而成。
architecture

Performance Test

使用webbench,测试non-keepalive和keepalive Http连接下的表现。

  • 10k 长连接测试 test1

  • 1k 短链接测试 test2

Others

  • 代码统计
    code

  • 内存泄露检测
    使用valgrid中memcheck工具,检测HttpServer内存泄露情况。
    检测方法: ./memcheck.sh

  • 监控
    使用top命令和/proc/${PID}/中内省,检测HttpServer运行时CPU利用率,内存以及文件描述符使用情况。
    使用方法: ./monitor.sh

About

A webserver developed using modern c++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 75.0%
  • C 17.1%
  • Makefile 4.0%
  • Roff 3.0%
  • Other 0.9%