- Throughput: Measure how many requests your server can handle per second.
- Latency: Measure response times (average and p99 latency) under varying loads.
- Concurrency: Test how the server performs with 10, 100, or 1,000 concurrent connections.
- CPU/Memory Usage: Profile the server under load to ensure efficient resource usage.
- Static File Serving:
- Serve files efficiently with support for partial requests (HTTP Range headers).
- Logging Support:
- Allow users to keep track of errors through logging.
- Customizable Error Handling:
- Add meaningful HTTP error codes and allow users to define error pages.
- HTTP 1.1 Support:
- Include persistent connections with keep-alive headers.
- Standards Adherence:
- Properly handle request/response headers, content encoding, and status codes.
- Content Negotiation:
- Respond based on
Accept
headers (e.g., Image or HTML).
- Respond based on
- Asynchronous I/O:
- Thread Pooling:
- Load Testing:
- Caching:
- Implement in-memory caching for frequently requested resources.
- Support
ETag
orLast-Modified
headers.
- Rate Limiting:
- Prevent abuse by limiting the number of requests from a single IP.
- Logging:
- Log requests and generate usage analytics (e.g., popular endpoints, error rates).
- Set Performance Targets:
- Handle 3k RPS (requests per second) with less than a 1% error rate.
- Compliance:
- Pass an HTTP compliance suite like
h2spec
.
- Pass an HTTP compliance suite like