feat(usockets): optimize high concurrency support up to 10,000+ connections
- Increase uSockets listen() backlog from 512 to 16384 in bsd.c - Add high concurrency test suite (5000-10000 concurrent connections) - Add HIGH_CONCURRENCY.md documentation with optimization guide - Add usockets/build.sh script for rebuilding uSockets library - Update README with latest benchmark results Performance (macOS M3 Max): - 5,000 concurrent: 81,524 RPS, 100% success - 10,000 concurrent: 24,198 RPS, 100% success System requirements: - kern.ipc.somaxconn >= 8192 - ulimit -n 65535
This commit is contained in:
@@ -2,6 +2,31 @@
|
||||
|
||||
High-performance server backend using [uSockets](https://github.com/uNetworking/uSockets) library.
|
||||
|
||||
## High Concurrency Performance
|
||||
|
||||
The included `libusockets_full.a` has been optimized with **backlog=16384** to support high concurrency:
|
||||
|
||||
| Concurrent | RPS | Success Rate |
|
||||
|------------|-----|--------------|
|
||||
| 4,000 | 112,614 | 100% |
|
||||
| 6,000 | 56,728 | 100% |
|
||||
| 8,000 | 33,255 | 100% |
|
||||
| 10,000 | 25,964 | 100% |
|
||||
|
||||
### System Requirements
|
||||
|
||||
For 10,000+ concurrent connections:
|
||||
|
||||
```bash
|
||||
# macOS
|
||||
sudo sysctl -w kern.ipc.somaxconn=8192
|
||||
ulimit -n 65535
|
||||
|
||||
# Linux
|
||||
sudo sysctl -w net.core.somaxconn=8192
|
||||
ulimit -n 65535
|
||||
```
|
||||
|
||||
## Performance
|
||||
|
||||
Based on benchmark tests (200 connections, 100K requests):
|
||||
|
||||
Reference in New Issue
Block a user