我正在运行gunicorn
通过 systemd 将服务器作为服务,这是示例service
file:
[Unit]
Description=Gunicorn NGINX
After=network.target
[Service]
User=root
Group=www-data
WorkingDirectory=/test
ExecStart=/usr/local/bin/gunicorn --workers 8 --threads 8 --backlog 100 --bind 10.0.0.20:5000 -m 777 abc:app
Restart=always
[Install]
WantedBy=multi-user.target
我现在想更换附近的号码--workers
and --threads
使用 shell 命令按核心数,以便动态选择核心数
nproc --all
有人可以帮我怎么做吗
您可以显式调用 shell 来进行 shell 解析。
ExecStart=/bin/bash -c '/usr/local/bin/gunicorn --workers "$(nproc --all)" --threads "$(nproc --all)" --backlog 100 --bind 10.0.0.20:5000 -m 777 abc:app'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)