Conversation
Remove invalid trailing comma in require section that was causing JSON parse errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Conflicts: # composer.json
- Increase recv buffer from 64KB to 128KB (configurable via recv_buffer_size) Larger buffers = fewer syscalls = better throughput - Add backend socket optimizations: - open_tcp_nodelay: Disable Nagle's algorithm for lower latency - socket_buffer_size: 2MB buffer for backend connections - Configurable connect timeout (default 5s, was hardcoded 30s) - Add new config options: - recv_buffer_size: Control forwarding buffer size - backend_connect_timeout: Control backend connection timeout - Add setConnectTimeout() method to TCP adapter Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Optimizes system for high-throughput TCP proxy testing: - File descriptor limits (2M) - TCP backlog (65535) - Socket buffers (128MB max) - TCP Fast Open, tw_reuse, window scaling - Local port range (1024-65535) - CPU governor (performance mode) Usage: sudo ./benchmarks/setup-linux.sh # temporary sudo ./benchmarks/setup-linux.sh --persist # permanent Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Conservative settings for production database proxies: - Keeps tcp_slow_start_after_idle=1 (default) to prevent bursts - Keeps tcp_no_metrics_save=0 (default) for cached route metrics - Uses tcp_fin_timeout=30 instead of aggressive 10 - Adds tcp_keepalive tuning to detect dead connections - Lower limits than benchmark script (still 1M connections) Use setup-linux.sh for benchmarks, setup-linux-production.sh for prod. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Single command to setup fresh Ubuntu/Debian droplet and run benchmarks: - Installs PHP 8.3 + Swoole - Installs Composer - Clones repo - Applies kernel tuning - Runs connection rate + throughput benchmarks Usage: curl -sL https://raw.githubusercontent.com/utopia-php/protocol-proxy/dev/benchmarks/bootstrap-droplet.sh | sudo bash Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New benchmark modes: - Sustained load: continuous requests for N seconds, monitors memory/latency/errors - Max connections: opens and holds N concurrent connections Usage: # 60 second sustained load test BENCH_DURATION=60 BENCH_CONCURRENCY=1000 php benchmarks/tcp-sustained.php # 5 minute soak test BENCH_DURATION=300 BENCH_CONCURRENCY=2000 php benchmarks/tcp-sustained.php # Max connections test (hold 50k connections) BENCH_MODE=max_connections BENCH_TARGET_CONNECTIONS=50000 php benchmarks/tcp-sustained.php Output includes: conn/s, req/s, error rate, active connections, throughput, latency, memory Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Updated bootstrap-droplet.sh targets: - Burst: 1M connections (was 400k) - Throughput: 16GB (was 8GB) - Sustained: 4000 concurrency for ~100k conn/s (was 1000) - Max connections test: 100k (was 50k) Added note: these are per-pod numbers, scale linearly with more pods. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
# Conflicts: # composer.json
…lit routing, Dockerfiles
Greptile SummaryThis PR is a comprehensive refactor and major feature expansion of the proxy library, renaming it from The architecture is well thought out — the
Confidence Score: 2/5
Important Files Changed
|
…w forwarder headers, non-root Dockerfile
…le logging, SMTP constants, TLSContext rename - Block IPv6-mapped IPv4 addresses (::ffff:) in SSRF validation - Check send() return values in TCP fast path, forward goroutine, and SMTP forwarding - Fix goroutine resource leak in TCP SwooleCoroutine error path - Replace all echo/error_log with Utopia\Console (log, success, info, error) - Extract SMTP magic numbers into class constants (RECV_BUFFER, PACKAGE_MAX_LENGTH, etc.) - Rename TlsContext → TLSContext (acronym casing convention) - Rename getTlsContext → getTLSContext in Config and all callers - Add workerStart callback support to HTTP SwooleCoroutine - Normalize timeout types to float across all Config classes - Add utopia-php/console dependency, remove unused utopia-php/cli Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…h validation - Replace custom isValidHostname() regex with Utopia\Validator\Hostname in both HTTP servers - Use Utopia\Validator\Range for port validation in Adapter::validate() - Use Utopia\Validator\IP for IP format validation in Adapter::validate() - Use Utopia\Validator\Text for TLS certificate path validation - Add utopia-php/validators dependency Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Create Handler trait with onRequest, forwardRequest, forwardRawRequest, addTelemetryHeaders, and isValidHostname - Both Swoole and SwooleCoroutine HTTP servers now use the trait - Eliminates ~300 lines of duplicated request-handling logic - Bug fixes in one location now apply to both server implementations Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s name instead Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Allow utopia-php/console 0.0.* to resolve alongside open-runtimes/executor 0.22.x Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary by CodeRabbit
New Features
Documentation
Tests
Chores