Git Product home page Git Product logo

httpserver's Introduction

HttpServer Project

A webserver developed using modern c++

License

Introduction

该项目参考muduo实现了一个多线程静态的web服务器。HttpServer采用c++11编写,支持Http中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

使用linux压测工具webbench,分别测试10k连接下,keepAlive和non-keepAlive请求。
60s本地压力测试,响应能力为15 million requests/min, 传输速度为34.64 M/s 。
60s同网段内测试,响应能力为0.75 million requests/min, 传输速度为1.67 M/s。

Others

  • 代码统计
    code

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

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

httpserver's People

Contributors

wenzhang-dev avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.