Improve accuracy in http.md

This commit is contained in:
2025-08-18 16:46:25 -04:00
parent 3a874b0acf
commit 1141251002

19
http.md
View File

@@ -10,8 +10,8 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
#### Accept Threads #### Accept Threads
- **Configurable number** of dedicated accept threads - **Configurable number** of dedicated accept threads
- Each thread runs **synchronous accept() loop** on listening socket - Each thread calls `accept` in a loop on listening socket
- Accept returns file descriptor used to construct connection object - `accept` returns file descriptor used to construct connection object
- Connection posted to epoll with **EPOLLIN | EPOLLONESHOT** interest - Connection posted to epoll with **EPOLLIN | EPOLLONESHOT** interest
#### Network Threads #### Network Threads
@@ -19,10 +19,11 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
- Each thread calls **epoll_wait()** to receive connection ownership - Each thread calls **epoll_wait()** to receive connection ownership
- **EPOLLONESHOT** ensures clean ownership transfer without thundering herd - **EPOLLONESHOT** ensures clean ownership transfer without thundering herd
- Handle connection state transitions and HTTP protocol processing - Handle connection state transitions and HTTP protocol processing
- Either respond directly or post the connection to a service
#### Service Threads #### Service Threads
- **Configurable service pipelines** (e.g., commit and status can share pipeline) - **Service Pipelines** (e.g., commit and status can share pipeline)
- **Dequeue connections** from shared LMAX Disruptor inspired ring buffer - **Dequeue connections** from shared LMAX Disruptor inspired ring buffer `src/ThreadPipeline.h`
- Process business logic and generate responses - Process business logic and generate responses
- **Post completed connections** back to epoll for response writing - **Post completed connections** back to epoll for response writing
@@ -61,7 +62,6 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
#### Ring Buffer Communication #### Ring Buffer Communication
- **Ring buffer** for high-performance inter-thread communication - **Ring buffer** for high-performance inter-thread communication
- **Shared ring buffers** between related services (e.g., commit and status share pipeline)
- **Backpressure handling** via ring buffer capacity limits - **Backpressure handling** via ring buffer capacity limits
### Error Handling ### Error Handling
@@ -69,18 +69,18 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
#### Backpressure Response #### Backpressure Response
- **Ring buffer full**: Network thread writes immediate error response - **Ring buffer full**: Network thread writes immediate error response
- **Partial write**: Connection re-posted to epoll with write interest - **Partial write**: Connection re-posted to epoll with write interest
- **Graceful degradation** under high load conditions - **Connections are rejected** if there are too many concurrent connections.
Tries to maintain a configurable limit (best effort only.)
#### Protocol Errors #### Protocol Errors
- **Malformed HTTP**: Proper HTTP error responses (400 Bad Request, etc.) - **Malformed HTTP**: Proper HTTP error responses (400 Bad Request, etc.)
- **Partial I/O**: Re-registration with epoll for completion - **Partial I/O**: Re-registration with epoll for completion
- **Client disconnection**: Clean connection state cleanup - **Client disconnection**: Clean up connection state
## Integration Points ## Integration Points
### Parser Selection ### Parser Selection
- **Content-Type header inspection** for parser routing - **Content-Type header inspection** for parser routing
- **ParserInterface implementation** for format-agnostic parsing
- **CommitRequestParser extensibility** for future format support (protobuf, msgpack) - **CommitRequestParser extensibility** for future format support (protobuf, msgpack)
### Configuration System ### Configuration System
@@ -94,7 +94,6 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
### Request Routing ### Request Routing
- **Path-based routing** to service handlers - **Path-based routing** to service handlers
- **Shared ring buffers** for related services with flexible pipeline configuration
- **Handler registration** for extensible endpoint support - **Handler registration** for extensible endpoint support
## Performance Characteristics ## Performance Characteristics
@@ -113,7 +112,6 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
### Resource Management ### Resource Management
- **Bounded memory usage** via arena reset and ring buffer limits - **Bounded memory usage** via arena reset and ring buffer limits
- **Graceful backpressure** prevents resource exhaustion - **Graceful backpressure** prevents resource exhaustion
- **Clean connection lifecycle** with deterministic cleanup
## Implementation Phases ## Implementation Phases
@@ -123,7 +121,6 @@ High-performance HTTP server implementation for WeaselDB using epoll-based event
- llhttp integration for request parsing - llhttp integration for request parsing
### Phase 2: Service Integration ### Phase 2: Service Integration
- Ring buffer implementation for service communication
- Request routing and handler registration - Request routing and handler registration
- Arena-based memory management - Arena-based memory management