{"id":50136551,"url":"https://github.com/bivex/sturdy-winner","last_synced_at":"2026-05-23T22:04:46.687Z","repository":{"id":327216966,"uuid":"1108381049","full_name":"bivex/sturdy-winner","owner":"bivex","description":"libreactor server via DDD","archived":false,"fork":false,"pushed_at":"2025-12-02T11:37:47.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-05T08:20:34.420Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bivex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-02T11:28:49.000Z","updated_at":"2025-12-02T11:37:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/bivex/sturdy-winner","commit_stats":null,"previous_names":["bivex/sturdy-winner"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/bivex/sturdy-winner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fsturdy-winner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fsturdy-winner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fsturdy-winner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fsturdy-winner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bivex","download_url":"https://codeload.github.com/bivex/sturdy-winner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bivex%2Fsturdy-winner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33413632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T18:09:33.147Z","status":"ssl_error","status_checked_at":"2026-05-23T18:09:31.380Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-23T22:04:41.102Z","updated_at":"2026-05-23T22:04:46.678Z","avatar_url":"https://github.com/bivex.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Libreactor - Extreme HTTP Performance Server\n\nOptimized HTTP server based on libreactor with extreme performance.\n\n## 🚀 Quick Start\n\n```bash\n# Compile with optimizations\n./compile.sh\n\n# Start the server\n./run-optimized.sh\n\n# Check status\n./status.sh\n\n# Stop the server\n./stop.sh\n```\n\n## 📊 Benchmarking\n\n```bash\n# Quick test\nwrk -t8 -c512 -d10s http://localhost:2342/plaintext\n\n# Full benchmark\n/var/www/benchmark-libreactor.sh\n```\n\n## ⚡ Performance Optimizations\n\n### Application Level Code\n- **SO_REUSEPORT + BPF filter** - connection distribution across CPUs\n- **Busy Poll (SO_BUSY_POLL)** - low latency for network operations\n- **TCP_NODELAY** - disabling Nagle algorithm\n- **SO_KEEPALIVE = 0** - disabling keepalive for performance\n- **Multi-process architecture** - process per CPU with CPU pinning\n\n### Compilation\n- `-O3 -march=native -flto` - maximum optimizations\n- `-DNDEBUG -fomit-frame-pointer -funroll-loops` - additional optimizations\n\n### System Level\n- **Kernel parameters**: `nospectre_v1 nospectre_v2 pti=off mds=off tsx_async_abort=off`\n- **Network sysctl**: 16MB buffers, busy poll, TCP optimizations\n- **Nftables** instead of iptables (minimal overhead)\n\n## 📁 Project Structure\n\n```\n/var/www/rads/\n├── build/                     # Build directory (generated during compilation)\n├── src/                       # Source code\n│   ├── domain/                # HTTP domain logic\n│   │   ├── http_response.c\n│   │   └── http_server.c\n│   ├── include/               # Header files\n│   │   ├── compat/           # Compatibility headers\n│   │   │   ├── dynamic.h\n│   │   │   └── reactor.h\n│   │   ├── domain/           # Domain headers\n│   │   │   ├── http_response.h\n│   │   │   └── http_server.h\n│   │   ├── infrastructure/   # Infrastructure headers\n│   │   │   └── server_infrastructure.h\n│   │   └── platform/         # Platform headers\n│   │       ├── log.h\n│   │       ├── process.h\n│   │       ├── signals.h\n│   │       ├── socket.h\n│   │       └── system.h\n│   ├── infrastructure/        # Server infrastructure\n│   │   └── server_infrastructure.c\n│   ├── main/                  # Main application files\n│   │   ├── libreactor-server.c\n│   │   └── libreactor.c\n│   └── platform/              # Platform utilities\n│       ├── log.c\n│       ├── process.c\n│       ├── signals.c\n│       ├── socket.c\n│       └── system.c\n├── compile.sh                 # Compilation with optimizations\n├── run-optimized.sh          # Start with CPU pinning\n├── stop.sh                   # Stop and cleanup\n├── status.sh                 # Check status\n├── Makefile                  # Alternative makefile\n├── drop_changes.sh           # Git changes reset\n├── fast_commits.sh           # Fast commits\n├── switch_branch.sh          # Branch switching\n├── git-init.sh               # Git repo initialization\n├── libreactor-server.dockerfile # Dockerfile for server\n├── libreactor.dockerfile     # Dockerfile for libreactor\n└── README.md                 # This file\n```\n\n## 🎯 Performance\n\n- **44k+ req/sec** on plaintext (3 CPUs, KVM virtualization, local test)\n- **41k+ req/sec** on JSON responses (3 CPUs, KVM virtualization)\n- **CPU spent on sendto()** (useful work)\n- **Minimal locks and context switches**\n\n## 🔧 API\n\n### Endpoints\n- `GET /plaintext` - returns \"Hello, World!\"\n- `GET /json` - returns `{\"message\":\"Hello, World!\"}`\n\n### Example Request\n```bash\ncurl http://localhost:2342/plaintext\n# Hello, World!\n\ncurl http://localhost:2342/json\n# {\"message\":\"Hello, World!\"}\n```\n\n## 🛠️ Development\n\n### Recompilation\n```bash\nmake clean\nmake CFLAGS=\"-O3 -march=native -flto -DNDEBUG\" libreactor-server\n```\n\n### Debug Build\n```bash\nmake CFLAGS=\"-O0 -g\" libreactor-server\n```\n\n## 📈 Monitoring\n\n### CPU Profiling\n```bash\nperf record -F 99 -g -p $(pgrep libreactor-server | head -1) -o perf.data -- sleep 10\nperf report -i perf.data\n```\n\n### System Calls\n```bash\nbpftrace -e 'tracepoint:syscalls:sys_enter_sendto { @[comm] = count(); } interval:s:1 { print(@); clear(@); }'\n```\n\n## 🔗 Links\n\n- [Libreactor](https://github.com/fredrikwidlund/libreactor)\n- [Extreme HTTP Performance Tuning](https://talawah.io/blog/extreme-http-performance-tuning-one-point-two-million/)\n- [SO_REUSEPORT](https://lwn.net/Articles/542629/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbivex%2Fsturdy-winner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbivex%2Fsturdy-winner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbivex%2Fsturdy-winner/lists"}