cal cpu core number

This commit is contained in:
virusdefender 2016-10-28 01:04:30 +08:00
parent 69bb2ae79b
commit 031b0b617b

View File

@ -1,4 +1,6 @@
#!/usr/bin/env bash
chown compiler:compiler /spj
echo 0 > /tmp/counter
gunicorn --workers 4 --threads 4 --error-logfile /log/gunicorn.log --bind 0.0.0.0:8080 server:wsgiapp
core=$(grep --count ^processor /proc/cpuinfo)
n=$(($core*4))
gunicorn --workers $n --threads $n --error-logfile /log/gunicorn.log --time 600 --bind 0.0.0.0:8080 server:wsgiapp