From 031b0b617bc74fe4b0b09dd12d6ce8c7c15ae406 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Fri, 28 Oct 2016 01:04:30 +0800 Subject: [PATCH] cal cpu core number --- server/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/run.sh b/server/run.sh index f13b057..fb6a82e 100644 --- a/server/run.sh +++ b/server/run.sh @@ -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 \ No newline at end of file