1. Implementing Connection Pooling
| Setting | Recommended |
| Pool size | 2x CPU cores |
| Idle timeout | 60-120s |
| Max lifetime | 30 min (avoid stale) |
| Health check | Validate before reuse |
| Per-upstream pool | Isolate noisy neighbors |
2. Using Keep-Alive Connections
| Benefit | Detail |
| Save TLS handshake | 1-2 RTT saved per request |
| Lower CPU | No new TCP/TLS setup |
| Better latency | p99 drops significantly |
| More memory | Trade-off |
3. Configuring HTTP/2 Server Push
Warning: Server Push was removed from Chrome (M106). Use 103 Early Hints with Link: rel=preload instead.
| Alternative | Detail |
| 103 Early Hints | Modern, broadly supported |
Link: rel=preload | Hint in response headers |
| HTTP/3 prioritization | Stream priorities |
4. Using Compression
| Algorithm | Recommendation |
| br (Brotli) | Default for text (HTTPS only) |
| gzip | Universal fallback |
| zstd | Better than gzip, growing support |
| identity | Already compressed (images, video) |
5. Implementing Request Pipelining
| Protocol | Support |
| HTTP/1.1 pipelining | Spec yes, practice broken (HOL) |
| HTTP/2 multiplex | Native, preferred |
| HTTP/3 streams | Multiplexed, no TCP HOL |
6. Configuring Database Connection Pooling
| Setting | Value |
| Pool size | (cores * 2) + spindles |
| Connection timeout | 30s |
| Validation query | SELECT 1 |
| Statement cache | Enable, size 256 |
| PgBouncer/RDS Proxy | External pooler for many clients |
7. Using Async Non-Blocking I/O
| Model | Implementations |
| Reactor (epoll) | NGINX, Envoy, Node.js |
| io_uring | Linux 5.1+ NEW |
| Coroutines | Go, Kotlin, Project Loom |
| Worker threads | Tomcat NIO, Netty |
8. Implementing CDN Integration
| CDN | Use |
| Cloudflare | Global edge, free tier |
| Fastly | VCL programmability |
| AWS CloudFront | S3/ALB integration |
| Akamai | Enterprise, large footprint |
| bunny.net | Cost-effective |
9. Setting Up Edge Caching
| Strategy | Detail |
| Cache-Control on origin | CDN respects directives |
| Stale-while-revalidate | Serve stale, refresh async |
| Surrogate-Control | CDN-only TTL |
| Surrogate-Key purge | Tag-based invalidation |
| Origin shielding | One regional cache → origin |
10. Using Content Delivery Optimization
| Technique | Benefit |
| HTTP/3 (QUIC) | 0-RTT, no HOL blocking |
| Brotli compression | 20-25% smaller than gzip |
| AVIF/WebP images | 50% smaller than JPEG |
| Anycast routing | Nearest POP |
| TCP BBR | Better congestion control |
| Connection coalescing | HTTP/2 reuse across origins |