Skip to content

v0.6.0

Choose a tag to compare

@Gouryella Gouryella released this 24 Dec 02:19
· 64 commits to main since this release
fa92896

Highlights

This release focuses on performance optimization and concurrency safety improvements, significantly enhancing throughput and stability under high-load scenarios.

⚠️ Breaking Changes

  • Removed manual GC tuning configuration in main.go, replaced with automatic tuning mode

✨ New Features

Connection Pool Optimization

  • Implemented connection pool preheating to eliminate cold start delay
  • Optimized pool scaling logic with burst load batch expansion support
  • Concurrent data session creation to accelerate scaling
  • Added ping loop keep-alive mechanism for each session
  • Introduced GetSessionStats method for detailed session statistics

Tunnel Management & Security

  • Implemented IP-based tunnel count and registration rate limits
  • Added rate limiter to prevent malicious registration behavior
  • Client IP address tracking for access control

Concurrency Safety Enhancement

  • CAS loop implementation for atomic operations on global tunnel counter
  • Added rollback mechanism to ensure proper resource release on registration failure
  • Combined atomic operations with locks for thread-safe IP rate limiting

⚡ Performance Improvements

Core Performance

  • Optimized session selection using min-heap, reducing time complexity from O(n) to O(log n)
  • Added bufio.Reader pool and buffer pool to reduce memory allocation
  • Implemented sharded lock manager for improved high-concurrency performance
  • Updated yamux with unified optimized configuration for better throughput
  • Added patterned GC tuning

HTTP Server

  • Used sync.Pool to reuse bufio.Writer, reducing GC pressure
  • Enabled TCP_NODELAY for improved response speed
  • Adjusted HTTP server timeout configuration to balance performance and security

Resource Management

  • Optimized stream open timeout control using context to prevent goroutine leaks
  • Improved shutdown process to ensure proper cleanup coroutine exit
  • Reduced maximum frame size from 10MB to 1MB to mitigate DoS risk
  • Used stack arrays instead of heap allocation for frame header reading

🔧 Other Changes

  • ID generator now exclusively uses crypto/rand, removed timestamp fallback
  • Added TryGenerateID for non-panic error handling
  • Upgraded test scripts from Python to Go implementation
  • Added nginx WebSocket proxy header configuration documentation

Upgrade Guide

This release primarily contains performance optimizations. When upgrading:

  1. Remove any custom GC configuration code if present
  2. Thoroughly test in high-load environments before production deployment

Full Changelog: v0.5.3...v0.6.0

What's Changed

Full Changelog: v0.5.3...v0.6.0