Add Gunicorn support for production in Vosk service and update requirements
This commit is contained in:
43
vosk/vosk_service/gunicorn_config.py
Normal file
43
vosk/vosk_service/gunicorn_config.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Gunicorn configuration for Vosk service with 192-core optimization
|
||||
|
||||
# Server socket
|
||||
bind = "0.0.0.0:5000"
|
||||
backlog = 2048
|
||||
|
||||
# Worker processes
|
||||
workers = 48 # 192/4 for optimal worker count
|
||||
worker_class = "sync"
|
||||
worker_connections = 1000
|
||||
max_requests = 1000
|
||||
max_requests_jitter = 50
|
||||
preload_app = True
|
||||
|
||||
# Timeout settings
|
||||
timeout = 300
|
||||
keepalive = 2
|
||||
graceful_timeout = 30
|
||||
|
||||
# Logging
|
||||
accesslog = "-"
|
||||
errorlog = "-"
|
||||
loglevel = "info"
|
||||
access_log_format = '%(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" %(D)s'
|
||||
|
||||
# Process naming
|
||||
proc_name = "vosk-service"
|
||||
|
||||
# Security
|
||||
limit_request_line = 4094
|
||||
limit_request_fields = 100
|
||||
limit_request_field_size = 8190
|
||||
|
||||
# Performance
|
||||
worker_tmp_dir = "/dev/shm"
|
||||
worker_exit_on_app_exit = True
|
||||
|
||||
# Memory management
|
||||
max_requests_jitter = 50
|
||||
preload_app = True
|
||||
|
||||
# Worker lifecycle
|
||||
worker_abort_on_app_exit = True
|
||||
Reference in New Issue
Block a user