В нем указано, что максимальное количество рабочих равно -1?
Код: Выделить всё
[2024-04-20 23:26:12 +0200] [165] [INFO] Starting gunicorn 22.0.0
[2024-04-20 23:26:12 +0200] [165] [INFO] Listening at: http://0.0.0.0:8000 (165)
[2024-04-20 23:26:12 +0200] [165] [INFO] Using worker: uvicorn.workers.UvicornWorker
[2024-04-20 23:26:12 +0200] [166] [INFO] Booting worker with pid: 166
OpenBLAS blas_thread_init: pthread_create failed for thread 1 of 2: Operation not permitted
OpenBLAS blas_thread_init: RLIMIT_NPROC -1 current, -1 max
Код: Выделить всё
"""
GUNICORN CONFIG
"""
import multiprocessing
import os
workers_per_core_str = os.getenv("WORKERS_PER_CORE", "1")
max_workers_str = os.getenv("MAX_WORKERS", 2)
use_max_workers = None
if max_workers_str:
use_max_workers = int(max_workers_str)
use_max_workers = 2
workers_per_core_str = "1"
web_concurrency_str = os.getenv("WEB_CONCURRENCY", None)
host = "0.0.0.0"
port = "8000"
bind_env = os.getenv("BIND", None)
use_loglevel = os.getenv("LOG_LEVEL", "info")
bind = "{}:{}".format(host, port)
cores = multiprocessing.cpu_count()
workers_per_core = float(workers_per_core_str)
default_web_concurrency = workers_per_core * cores
if web_concurrency_str:
web_concurrency = int(web_concurrency_str)
assert web_concurrency > 0
else:
web_concurrency = max(int(default_web_concurrency), 2)
if use_max_workers:
web_concurrency = min(web_concurrency, use_max_workers)
accesslog_var = "/gunicorn.log"
use_accesslog = accesslog_var or None
errorlog_var = "/gunicorn.err"
use_errorlog = errorlog_var or None
graceful_timeout_str = os.getenv("GRACEFUL_TIMEOUT", "120")
timeout_str = os.getenv("TIMEOUT", "120")
keepalive_str = os.getenv("KEEP_ALIVE", "5")
Вот мой вывод ulimit с хоста
Код: Выделить всё
ulimit -a
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7841
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) 7841
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Код: Выделить всё
ulimit -a
real-time non-blocking time (microseconds, -R) unlimited
core file size (blocks, -c) unlimited
data seg size (kbytes, -d) unlimited
scheduling priority (-e) 0
file size (blocks, -f) unlimited
pending signals (-i) 7841
max locked memory (kbytes, -l) 64
max memory size (kbytes, -m) unlimited
open files (-n) 1048576
pipe size (512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority (-r) 0
stack size (kbytes, -s) 8192
cpu time (seconds, -t) unlimited
max user processes (-u) unlimited
virtual memory (kbytes, -v) unlimited
file locks (-x) unlimited
Подробнее здесь: https://stackoverflow.com/questions/783 ... -up-worker
Мобильная версия