Download the PHP package highperapp/zero-downtime without Composer
On this page you can find all versions of the php package highperapp/zero-downtime. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download highperapp/zero-downtime
More information about highperapp/zero-downtime
Files in highperapp/zero-downtime
Package zero-downtime
Short Description Zero-downtime deployment and hot reload for HighPer Framework with WebSocket connection migration
License MIT
Informations about the package zero-downtime
HighPer Zero-Downtime Reload System
Complete zero-downtime deployment and hot reload system for HighPer Framework with WebSocket connection migration support across HTTP/1.1, HTTP/2 (RFC 8441), and HTTP/3 protocols.
๐ Features
WebSocket Protocol Support
- โ HTTP/1.1 WebSocket - RFC 6455 compliant via Amp WebSocket
- โ HTTP/2 WebSocket - RFC 8441 implementation with CONNECT method
- โ HTTP/3 WebSocket - QUIC-based WebSocket tunneling
Zero-Downtime Strategies
- ๐ต๐ข Blue-Green Deployment - Complete worker replacement
- ๐ Rolling Deployment - Gradual worker replacement
- ๐ค Socket Handoff - Master process handoff with FD transfer
Connection Migration
- ๐ฆ State Serialization - Protocol-specific connection state capture
- ๐ Cross-Protocol Support - HTTP/1.1 โ HTTP/2 โ HTTP/3 migration
- โก Compression & Encryption - Optimized state transfer
Request Buffering
- ๐ Proxy-Level Queuing - Prevents request loss during transitions
- ๐ฅ Worker-Specific Buffers - Granular request routing
- ๐ Overflow Strategies - Reject, evict oldest, or compress
- ๐ท๏ธ Priority Headers - Request prioritization support
๐ Installation
โ๏ธ Configuration
Environment Variables
๐ง Usage
Basic Integration
Service Provider Integration
The package includes a service provider for automatic integration:
Manual Component Usage
๐ WebSocket Migration
HTTP/2 WebSocket (RFC 8441)
Connection State Serialization
๐ฆ Deployment Strategies
Blue-Green Deployment
- Start request queuing - Buffer incoming requests
- Serialize connections - Capture all WebSocket states
- Spawn green workers - New worker processes
- Transfer sockets - Hand off listening sockets
- Migrate connections - Restore WebSocket states
- Replay requests - Process buffered requests
- Terminate blue workers - Clean shutdown
Rolling Deployment
Individual worker replacement with minimal disruption:
Socket Handoff
Master process replacement with complete state transfer:
๐ฅ Health Monitoring
Health Check Endpoints
Statistics API
๐งช Testing
Run the comprehensive test suite:
Test Coverage
Unit Tests (43 tests)
- โ ConnectionStateSerializer - Active/idle state management
- โ ProxyRequestQueue - Request buffering and prioritization
- โ ZeroDowntimeBootstrap - Deployment orchestration
- โ Worker management and socket handling
Integration Tests
- โ End-to-end zero-downtime reload workflows
- โ Connection migration with request buffering coordination
- โ Blue-green deployment strategy validation
- โ Health monitoring and graceful shutdown
Performance Tests
- โ 1000+ connection serialization (< 1 second)
- โ 10,000+ request buffering (< 5 seconds)
- โ Memory stability during extended operations
- โ Linear scaling validation
Concurrency Tests
- โ Thread-safe connection registration
- โ Race condition protection
- โ Concurrent reload isolation
- โ Worker handoff atomicity
๐๏ธ Advanced Configuration
Custom Connection Migration
Request Priority Headers
Worker Auto-Restart
๐ Security Considerations
Connection State Security
Socket Path Permissions
Request Buffer Limits
Worker Process Isolation
๐ Performance Metrics
Benchmarked Performance
Connection Migration Performance
Request Buffering Performance
Zero-Downtime Reload Metrics
Real-time Monitoring
๐ Troubleshooting
Common Issues
Connection Migration Fails
Request Buffer Overflow
Worker Handoff Timeout
๐ API Reference
ZeroDowntimeBootstrap
ConnectionStateSerializer
ProxyRequestQueue
Response Formats
performZeroDowntimeReload() Response:
getHealthStatus() Response:
๐ค Contributing
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature
) - Commit changes (
git commit -m 'Add amazing feature'
) - Push to branch (
git push origin feature/amazing-feature
) - Open Pull Request
๐ง Requirements
- PHP: ^8.3|^8.4
- Extensions: ext-pcntl, ext-posix, ext-sockets
- Dependencies: highperapp/websockets ^1.1
- Framework: Compatible with HighPer Framework
- Environment: Linux/Unix systems (process management)
๐ License
This package is open-sourced software licensed under the MIT license.
๐ Acknowledgments
- RFC 8441 - WebSocket over HTTP/2 specification
- Amp Framework - Asynchronous PHP components
- QUIC Protocol - HTTP/3 transport layer
- HighPer Framework - High-performance PHP framework
All versions of zero-downtime with dependencies
ext-pcntl Version *
ext-posix Version *
ext-sockets Version *
highperapp/websockets Version ^1.1
highperapp/compression Version ^1.0