Giter VIP home page Giter VIP logo

lingtoshigure / web.d Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kingking888/web.d

0.0 0.0 0.0 21.47 MB

💻 本项目为 C++11 编写的 Web 服务器,解析了 get、head 请求,可处理静态资源,支 持HTTP长连接,支持管线化请求,并实现了异步日志,记录服务器运行状态

License: Other

C++ 8.09% Shell 0.06% Makefile 0.06% HTML 91.74% Perl 0.04%

web.d's Introduction

WebServer

测试页:Apriluestc's.pub

项目介绍

本项目为 C++ 11 编写的高性能 Web 服务器,解析了 GET、POST 请求,可静态处理资源,支持 HTTP 长连接、支持 管线化请求,并实现了异步日志,实时记录服务器运行状态

技术特点

  • 程序使用 Epoll 边沿触发、非阻塞 IO、Reactor 模式
  • 使用多线程技术充分发挥多核 CPU 性能,并使用线程池规避线程频繁创建销毁的开销
  • 使用基于时间轮的定时器关闭超时请求和剔除不活跃连接
  • 主线程负责 accept 请求,并轮询分发 fd 给其他 IO 线程,这样一来锁竞争只会出现在主线程和某一特定线程
  • 使用 eventfd 跨线程异步唤醒
  • 使用 TCP 环形缓冲区,减少 read、write 等系统调用的次数,进而减少系统开销
  • 使用智能指针、RAII 机制规避程序中出现内存泄漏的可能
  • 实现异步日志实时记录服务器运行状态(便于 Debug)
  • webd 服务以 dameon 进程运行

项目来源

web.d's People

Contributors

apriluestc 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.