# High performance web server **Repository Path**: dingfudong/high-performance-web-server ## Basic Information - **Project Name**: High performance web server - **Description**: c++开发的高性能web服务器: 主要实现了: 1.epoll+非阻塞IO 2.reactor事件处理模式 3.线程池+数据库连接池 4.http请求报文解析+http响应报文生成 5.同步和异步日志 - **Primary Language**: C++ - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2021-03-14 - **Last Updated**: 2022-08-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ### ### # High performance web server **#### 介绍** 基于c++开发的web服务器 **#### 软件架构** - server - main.cc #入口函数; - server.cc #服务器创建(初始化线程池、数据库连接池、epoll、处理连接事件); - epoll_manager.cc #封装epoll; - buffer - buffer.cc #封装buffer(writev()和readv()基础buffer); - http - http_conn.cc #http连接类,每个对象对应一个http连接实例,包括HttpRequest和HttpResponse类以及http请求报文解析和http响应报文构造方法; - http_request.cc #HttpRequest类,负责解析http请求报文; - http_response.cc #HttpResponse类,负责构造http响应报文; - pool - dbconnpool.cc #数据库连接池; - thread_pool.cc #线程池,采用信号量实现任务的消费者; - dbconn_interface.cc #数据库连接接口,实现从数据库连接池中获取连接以及释放连接到连接池; - log - concurrent_queue.h #使用c++11实现线程安全的双向队列; - log.cc #日志类,采用线程安全双向队列实现同步/异步日志; - resources #静态资源 - CMakeLists.txt #cmake编译脚本 - webserver 编译后的服务器运行文件 **#### 运行本项目** 1. git clone 2. cmake . 3. make 4. ./webserver **#### 参与贡献** 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request