-
Notifications
You must be signed in to change notification settings - Fork 269
Open
Labels
feature requestNew feature or requestNew feature or request
Description
Describe the feature
Upgrade the vLLM router to use uvicorn[standard]
instead of basic uvicorn
for significant performance improvements. This includes automatic integration of uvloop (high-performance event loop) and httptools (fast HTTP parser) to enhance async I/O operations and HTTP request processing.
Performance Comparison
Feature | Basic uvicorn |
uvicorn[standard] |
---|---|---|
Event Loop | Standard asyncio | uvloop (2-4x faster) |
HTTP Parser | Pure Python (h11) | Optimized C code (httptools) |
WebSockets | Basic support | High-performance implementation |
Memory Usage | Higher overhead | More efficient |
I/O Performance | Good for development | Excellent for production |
Best For | Development & testing | Production workloads |
Real-World Impact
- Faster response times for API requests
- Better handling of concurrent connections
- Improved performance for disaggregated prefill scenarios
- Lower resource usage in production environments
🔧 Implementation Details
Files to be modified:
src/vllm_router/requirements.txt
- Update uvicorn dependency- No code changes required (uvicorn[standard] auto-detects optimizations)
Changes needed:
# In pyproject.toml and requirements.txt
- uvicorn==0.34.0
+ uvicorn[standard]==0.34.0
📚 References and Technical Background
uvloop Performance Research:
- uvloop: Blazing fast Python networking - MagicStack - Original uvloop announcement showing 2x+ performance gains over Node.js
- Make FastAPI CPU-bound Endpoints 2X Faster - Amir Karimi - Real-world benchmarks showing 2x performance improvement with async endpoints
FastAPI + uvicorn[standard] Benefits:
- FastAPI + Uvicorn = Blazing Speed - Leapcell - Comprehensive guide on uvicorn[standard] components and performance benefits
Industry Adoption:
- uvloop is the same technology that powers Node.js performance (built on libuv)
- httptools uses the same HTTP parser as Node.js and Nginx
- Used by major Python web frameworks in production environments
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request