Update stale documentation

This commit is contained in:
2025-09-05 13:04:34 -04:00
parent e67e4aee17
commit ed3cf25936
4 changed files with 39 additions and 8 deletions

10
api.md
View File

@@ -257,6 +257,16 @@ Removes a retention policy, which may allow the log to be truncated.
----- -----
## `GET /ok`
Simple health check endpoint.
### Response
Returns `200 OK` with minimal content for basic health monitoring.
-----
## `GET /metrics` ## `GET /metrics`
Retrieves server metrics for monitoring. Retrieves server metrics for monitoring.

View File

@@ -18,9 +18,7 @@ Controls server networking, threading, and request handling behavior.
| Parameter | Type | Default | Description | | Parameter | Type | Default | Description |
|-----------|------|---------|-------------| |-----------|------|---------|-------------|
| `bind_address` | string | `"127.0.0.1"` | IP address to bind the server to | | `interfaces` | array of objects | TCP on 127.0.0.1:8080 | Network interfaces to listen on. Each interface can be TCP or Unix socket |
| `port` | integer | `8080` | Port number to listen on |
| `unix_socket_path` | string | `""` (empty) | Unix domain socket path. If specified, takes precedence over TCP |
| `max_request_size_bytes` | integer | `1048576` (1MB) | Maximum size for incoming requests. Requests exceeding this limit receive a `413 Content Too Large` response | | `max_request_size_bytes` | integer | `1048576` (1MB) | Maximum size for incoming requests. Requests exceeding this limit receive a `413 Content Too Large` response |
| `io_threads` | integer | `1` | Number of I/O threads for handling connections and network events | | `io_threads` | integer | `1` | Number of I/O threads for handling connections and network events |
| `epoll_instances` | integer | `io_threads` | Number of epoll instances to reduce kernel contention (max: io_threads). Lower values allow multiple threads per epoll for better load balancing, higher values reduce contention | | `epoll_instances` | integer | `io_threads` | Number of epoll instances to reduce kernel contention (max: io_threads). Lower values allow multiple threads per epoll for better load balancing, higher values reduce contention |
@@ -47,16 +45,25 @@ Controls behavior of the `/v1/subscribe` endpoint and SSE streaming.
| `max_buffer_size_bytes` | integer | `10485760` (10MB) | Maximum amount of unconsumed data to buffer for slow subscribers. Connections are closed if this limit is exceeded | | `max_buffer_size_bytes` | integer | `10485760` (10MB) | Maximum amount of unconsumed data to buffer for slow subscribers. Connections are closed if this limit is exceeded |
| `keepalive_interval_seconds` | integer | `30` | Interval between keepalive comments in the Server-Sent Events stream to prevent idle timeouts on network proxies | | `keepalive_interval_seconds` | integer | `30` | Interval between keepalive comments in the Server-Sent Events stream to prevent idle timeouts on network proxies |
### Benchmark Configuration (`[benchmark]`)
Controls benchmarking and health check behavior.
| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `ok_resolve_iterations` | integer | `7000` | CPU-intensive loop iterations for `/ok` requests in resolve stage. 0 = health check only, 7000 = default benchmark load (~650ns, 1M req/s) |
## Example Configuration ## Example Configuration
```toml ```toml
# WeaselDB Configuration File # WeaselDB Configuration File
[server] [server]
# Network configuration # Network interfaces - can specify multiple TCP and/or Unix socket interfaces
bind_address = "0.0.0.0" interfaces = [
port = 8080 { type = "tcp", address = "0.0.0.0", port = 8080 },
# unix_socket_path = "weaseldb.sock" # Alternative to TCP # { type = "unix", path = "weaseldb.sock" }, # Alternative Unix socket
]
# Performance tuning # Performance tuning
max_request_size_bytes = 2097152 # 2MB max_request_size_bytes = 2097152 # 2MB
@@ -74,6 +81,9 @@ request_id_retention_versions = 50000
[subscription] [subscription]
max_buffer_size_bytes = 52428800 # 50MB max_buffer_size_bytes = 52428800 # 50MB
keepalive_interval_seconds = 15 keepalive_interval_seconds = 15
[benchmark]
ok_resolve_iterations = 10000 # Higher load for performance testing
``` ```
## Configuration Loading ## Configuration Loading

View File

@@ -50,11 +50,18 @@ ninja test # or ctest
**Individual targets:** **Individual targets:**
- `./test_arena_allocator` - Arena allocator unit tests - `./test_arena_allocator` - Arena allocator unit tests
- `./test_commit_request` - JSON parsing and validation tests - `./test_commit_request` - JSON parsing and validation tests
- `./test_http_handler` - HTTP protocol handling tests
- `./test_metric` - Metrics system tests
- `./test_api_url_parser` - API URL parsing tests
- `./test_server_connection_return` - Connection lifecycle tests
**Benchmarking:** **Benchmarking:**
- `./bench_arena_allocator` - Memory allocation performance - `./bench_arena_allocator` - Memory allocation performance
- `./bench_commit_request` - JSON parsing performance - `./bench_commit_request` - JSON parsing performance
- `./bench_parser_comparison` - Compare vs nlohmann::json and RapidJSON - `./bench_parser_comparison` - Compare vs nlohmann::json and RapidJSON
- `./bench_metric` - Metrics system performance
- `./bench_thread_pipeline` - Lock-free pipeline performance
- `./bench_format_comparison` - String formatting performance
**Debug tools:** **Debug tools:**
- `./debug_arena` - Analyze arena allocator behavior - `./debug_arena` - Analyze arena allocator behavior
@@ -73,6 +80,9 @@ ninja test # or ctest
- **toml11** - TOML configuration parsing - **toml11** - TOML configuration parsing
- **doctest** - Testing framework - **doctest** - Testing framework
- **nanobench** - Benchmarking library - **nanobench** - Benchmarking library
- **nlohmann/json** - JSON library (used in benchmarks)
- **RapidJSON** - High-performance JSON library (used in benchmarks)
- **llhttp** - Fast HTTP parser
--- ---
@@ -119,7 +129,7 @@ Ultra-fast memory allocator optimized for request/response patterns:
- **Streaming data processing** with partial message handling - **Streaming data processing** with partial message handling
- **Connection lifecycle hooks** for initialization and cleanup - **Connection lifecycle hooks** for initialization and cleanup
#### **Thread Pipeline** (`src/ThreadPipeline.h`) #### **Thread Pipeline** (`src/thread_pipeline.hpp`)
A high-performance, multi-stage, lock-free pipeline for inter-thread communication. A high-performance, multi-stage, lock-free pipeline for inter-thread communication.

View File

@@ -25,6 +25,7 @@
### Infrastructure & Tooling ### Infrastructure & Tooling
- [x] Implement thread-safe Prometheus metrics library and serve `GET /metrics` endpoint - [x] Implement thread-safe Prometheus metrics library and serve `GET /metrics` endpoint
- [ ] Implement gperf-based HTTP routing for efficient request dispatching - [ ] Implement gperf-based HTTP routing for efficient request dispatching
- [ ] Replace nlohmann/json with simdjson DOM API in parser comparison benchmarks
- [ ] Implement HTTP client for S3 interactions - [ ] Implement HTTP client for S3 interactions
- [ ] Design `HttpClient` class following WeaselDB patterns (factory creation, arena allocation, RAII) - [ ] Design `HttpClient` class following WeaselDB patterns (factory creation, arena allocation, RAII)
- [ ] Implement connection pool with configurable limits (max connections, idle timeout) - [ ] Implement connection pool with configurable limits (max connections, idle timeout)