All Projects → linyacool → Webserver

linyacool / Webserver

Licence: mit
A C++ High Performance Web Server

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
Makefile
30231 projects
Roff
2310 projects
CMake
9771 projects
shell
77523 projects

Projects that are alternatives of or similar to Webserver

Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-99.45%)
Mutual labels:  thread-pool, epoll, http-server, webserver
WebServer
High-performance multi-threaded tcp network server in c++11
Stars: ✭ 58 (-98.61%)
Mutual labels:  http-server, reactor, epoll
WebServer
C++高性能网络服务器
Stars: ✭ 53 (-98.73%)
Mutual labels:  webserver, reactor, epoll
Mgx
🌈 A high performance network framework written in c++ (support tcp and http)
Stars: ✭ 15 (-99.64%)
Mutual labels:  http-server, thread-pool, epoll
Libhv
🔥 比libevent、libuv更易用的国产网络库。A c/c++ network library for developing TCP/UDP/SSL/HTTP/WebSocket client/server.
Stars: ✭ 3,355 (-19.43%)
Mutual labels:  http-server, webserver, epoll
wine
A lightweight and flexible framework to help build elegant web API
Stars: ✭ 39 (-99.06%)
Mutual labels:  webserver, http-server
HttpServerLite
TCP-based simple HTTP and HTTPS server, written in C#.
Stars: ✭ 44 (-98.94%)
Mutual labels:  webserver, http-server
Jarvis
APL-based web service framework supporting JSON or REST
Stars: ✭ 17 (-99.59%)
Mutual labels:  webserver, http-server
stirfry
StirFry is a self contained and lightweight web framework for nodejs
Stars: ✭ 24 (-99.42%)
Mutual labels:  webserver, http-server
EthernetWebServer SSL
Simple TLS/SSL Ethernet WebServer, HTTP Client and WebSocket Client library for for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21, SAMD51, STM32F/L/H/G/WB/MP1, nRF52 and RASPBERRY_PI_PICO boards using Ethernet shields W5100, W5200, W5500, ENC28J60 or Teensy 4.1 NativeEthernet/QNEthernet. It now supports Ethernet TLS/SSL Client. The library supports …
Stars: ✭ 40 (-99.04%)
Mutual labels:  webserver, http-server
fancy
High performance web server
Stars: ✭ 20 (-99.52%)
Mutual labels:  http-server, epoll
phpkoa
PHP异步编程: 基于 PHP 实(chao)现(xi) NODEJS web框架 KOA。
Stars: ✭ 52 (-98.75%)
Mutual labels:  webserver, http-server
hasses
Hyper's Asynchronous Server Sent event (SSE) notification Server
Stars: ✭ 18 (-99.57%)
Mutual labels:  webserver, epoll
Kvantum
An intellectual (HTTP/HTTPS) web server with support for server side templating (Crush, Apache Velocity and JTwig)
Stars: ✭ 17 (-99.59%)
Mutual labels:  webserver, http-server
Crow
A Fast and Easy to use microframework for the web.
Stars: ✭ 1,718 (-58.74%)
Mutual labels:  webserver, http-server
quickserv
Dangerously user-friendly web server for quick prototyping and hackathons
Stars: ✭ 275 (-93.4%)
Mutual labels:  webserver, http-server
restana
Super fast and minimalist framework for building REST micro-services.
Stars: ✭ 380 (-90.87%)
Mutual labels:  webserver, http-server
EthernetWebServer
This is simple yet complete WebServer library for AVR, Portenta_H7, Teensy, SAM DUE, SAMD21/SAMD51, nRF52, STM32, RP2040-based, etc. boards running Ethernet shields. The functions are similar and compatible to ESP8266/ESP32 WebServer libraries to make life much easier to port sketches from ESP8266/ESP32. Coexisting now with `ESP32 WebServer` and…
Stars: ✭ 118 (-97.17%)
Mutual labels:  webserver, http-server
Gev
🚀Gev is a lightweight, fast non-blocking TCP network library based on Reactor mode. Support custom protocols to quickly and easily build high-performance servers.
Stars: ✭ 1,082 (-74.02%)
Mutual labels:  reactor, epoll
Eomaia
一个基于reactor模式的Linux/C++网络库,支持one loop per thread机制。
Stars: ✭ 159 (-96.18%)
Mutual labels:  reactor, epoll

A C++ High Performance Web Server

Build Status license

Introduction

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

测试页:http://www.linya.pub/

Part Ⅰ Part Ⅱ Part Ⅲ Part Ⅳ Part Ⅴ Part Ⅵ
并发模型 连接的维护 版本历史 测试及改进 项目目的 面试问题

Envoirment

  • OS: Ubuntu 14.04
  • Complier: g++ 4.8

Build

./build.sh

Usage

./WebServer [-t thread_numbers] [-p port] [-l log_file_path(should begin with '/')]

Technical points

  • 使用Epoll边沿触发的IO多路复用技术,非阻塞IO,使用Reactor模式
  • 使用多线程充分利用多核CPU,并使用线程池避免线程频繁创建销毁的开销
  • 使用基于小根堆的定时器关闭超时请求
  • 主线程只负责accept请求,并以Round Robin的方式分发给其它IO线程(兼计算线程),锁的争用只会出现在主线程和某一特定线程中
  • 使用eventfd实现了线程的异步唤醒
  • 使用双缓冲区技术实现了简单的异步日志系统
  • 为减少内存泄漏的可能,使用智能指针等RAII机制
  • 使用状态机解析了HTTP请求,支持管线化
  • 支持优雅关闭连接  

Model

并发模型为Reactor+非阻塞IO+线程池,新连接Round Robin分配,详细介绍请参考并发模型 并发模型

代码统计

cloc

Others

除了项目基本的代码,进服务器进行压测时,对开源测试工具Webbench增加了Keep-Alive选项和测试功能: 改写后的Webbench

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].