import multiprocessing

bind = "0.0.0.0:5001"

# gthread workers handle multiple concurrent requests per worker via threads.
# Ideal for I/O-bound Flask apps with DB queries.
# 4 workers × 4 threads = 16 concurrent requests.
workers = 8
threads = 4
worker_class = "gthread"
worker_connections = 1000

# Recycle workers after N requests to prevent memory leaks
max_requests = 1000
max_requests_jitter = 50

timeout = 120
keepalive = 5
accesslog = "/var/log/nexus-pos/access.log"
errorlog = "/var/log/nexus-pos/error.log"
loglevel = "info"
