# linyacool/webserver

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/linyacool-webserver).**

8,213 stars · 2,124 forks · C++ · MIT

## Links

- GitHub: https://github.com/linyacool/WebServer
- awesome-repositories: https://awesome-repositories.com/repository/linyacool-webserver.md

## Topics

`cpp11` `epoll` `http` `http-server` `raii` `reactor` `thread-pool` `webserver`

## Description

This is a high-performance C++ HTTP web server designed for delivering static content. It operates as an asynchronous event loop server that combines IO multiplexing with worker thread pools to handle concurrent requests without blocking.

The server specializes in TCP connection management, featuring keep-alive sessions, request pipelining, and timer-based timeout tracking for idle sockets. To ensure high throughput, it utilizes double-buffered asynchronous logging and background threads to prevent disk I/O latency from impacting network traffic.

The system covers broad capability areas including static resource delivery, concurrent connection management, and network resource tracking to reclaim system memory and available sockets.

## Tags

### Web Development

- [Static Content Delivery](https://awesome-repositories.com/f/web-development/static-content-delivery.md) — Designed as a high-performance server for the delivery of static files and resources to web clients. ([source](https://github.com/linyacool/webserver#readme))
- [High-Performance HTTP Servers](https://awesome-repositories.com/f/web-development/high-performance-http-servers.md) — A high-performance C++ implementation optimized for low-latency static content delivery.
- [Static File Servers](https://awesome-repositories.com/f/web-development/web-infrastructure-deployment/web-server-capabilities/static-file-servers.md) — Serves static assets from designated directories using a concurrent thread pool architecture.

### Networking & Communication

- [IO Multiplexing](https://awesome-repositories.com/f/networking-communication/connection-multiplexing/io-multiplexing.md) — Employs IO multiplexing to monitor multiple network sockets on a single thread, enabling high concurrency.
- [HTTP Keep-Alive Connections](https://awesome-repositories.com/f/networking-communication/nat-traversal-mechanisms/keep-alive-signaling/http-keep-alive-connections.md) — Optimizes TCP connectivity through HTTP keep-alive sessions and request pipelining.
- [Persistent HTTP Connections](https://awesome-repositories.com/f/networking-communication/persistent-http-connections.md) — Maintains persistent TCP keep-alive sessions to reduce the overhead of repeated handshakes for multiple HTTP requests.
- [Persistent TCP Connections](https://awesome-repositories.com/f/networking-communication/persistent-tcp-connections.md) — Enables multiple requests over a single TCP session using long-lived connections and request pipelining for high performance. ([source](https://github.com/linyacool/webserver#readme))
- [Request Timeout Management](https://awesome-repositories.com/f/networking-communication/distributed-systems-p2p/distributed-computing/communication-protocols/request-timeout-management.md) — Implements request timeout management to automatically close inactive connections and reclaim system resources.
- [TCP Session Management](https://awesome-repositories.com/f/networking-communication/tcp-session-management.md) — Manages TCP session state, including keep-alive durations and request pipelining for optimized socket usage.

### Programming Languages & Runtimes

- [Asynchronous Event Loops](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/concurrency-models/asynchronous-event-loops.md) — Operates as an asynchronous event loop server to handle concurrent network requests without blocking.

### Software Engineering & Architecture

- [Asynchronous Task Processing](https://awesome-repositories.com/f/software-engineering-architecture/asynchronous-task-processing.md) — Distributes network events to a worker thread pool via a synchronized queue for asynchronous task processing. ([source](https://github.com/linyacool/WebServer/blob/master/%E7%89%88%E6%9C%AC%E5%8E%86%E5%8F%B2.md))
- [Concurrent Request Pools](https://awesome-repositories.com/f/software-engineering-architecture/object-pooling/task-pools/concurrent-request-pools.md) — Processes multiple simultaneous client requests using a combined approach of thread pools and IO multiplexing. ([source](https://github.com/linyacool/WebServer/blob/master/%E7%89%88%E6%9C%AC%E5%8E%86%E5%8F%B2.md))
- [Event Logging](https://awesome-repositories.com/f/software-engineering-architecture/event-logging.md) — Implements event logging to track server activity and requests using asynchronous background writes. ([source](https://github.com/linyacool/WebServer/blob/master/%E5%B9%B6%E5%8F%91%E6%A8%A1%E5%9E%8B.md))
- [Connection Timeout Heaps](https://awesome-repositories.com/f/software-engineering-architecture/priority-heaps/connection-timeout-heaps.md) — Manages connection timeouts using a priority queue (timer-heap) to reclaim system memory and sockets from idle clients.

### System Administration & Monitoring

- [Static Worker Pools](https://awesome-repositories.com/f/system-administration-monitoring/alert-thresholds/thread-pool/configurable-worker-thread-pools/static-worker-pools.md) — Distributes incoming network events to a fixed-size pool of pre-allocated worker threads to ensure non-blocking request handling.
- [Asynchronous Logging](https://awesome-repositories.com/f/system-administration-monitoring/asynchronous-logging.md) — Provides a non-blocking asynchronous logging workflow to prevent disk I/O from impacting network performance.

### Data & Databases

- [Double-Buffered Log Writing](https://awesome-repositories.com/f/data-databases/asynchronous-write-buffering/double-buffered-log-writing.md) — Uses a double-buffered asynchronous logging system to record server events without interrupting the primary execution flow.

### DevOps & Infrastructure

- [Connection Termination](https://awesome-repositories.com/f/devops-infrastructure/client-connectivity-tools/connection-termination.md) — Gracefully handles connection termination by detecting closed sockets and flushing remaining data before releasing resources. ([source](https://github.com/linyacool/WebServer/blob/master/%E8%BF%9E%E6%8E%A5%E7%9A%84%E7%BB%B4%E6%8A%A4.md))
- [Idle](https://awesome-repositories.com/f/devops-infrastructure/client-connectivity-tools/connection-termination/idle.md) — Implements a timer-heap system to monitor connection idle times and automatically close unresponsive sockets to reclaim memory. ([source](https://github.com/linyacool/WebServer/blob/master/%E5%B9%B6%E5%8F%91%E6%A8%A1%E5%9E%8B.md))

### Operating Systems & Systems Programming

- [Background I/O Queues](https://awesome-repositories.com/f/operating-systems-systems-programming/asynchronous-i-o-libraries/background-i-o-queues.md) — Implements a background I/O queue to offload file system writes and prevent storage latency from blocking network traffic.
