From 38e7e69c0b0db058fc6e7e3d546d3d4036b082eb Mon Sep 17 00:00:00 2001 From: Yun Huang Date: Sat, 24 Mar 2018 00:28:34 +0800 Subject: [PATCH] Integrate uwsgi with django To enable parallel processing of framework services Change-Id: I3142c2ea742918027e7f397b6fe9aece329788a5 Issue-ID: MULTICLOUD-187 Signed-off-by: Yun Huang --- multivimbroker/requirements.txt | 4 ++++ multivimbroker/run.sh | 3 ++- multivimbroker/stop.sh | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/multivimbroker/requirements.txt b/multivimbroker/requirements.txt index 1d8330c..5aadc57 100644 --- a/multivimbroker/requirements.txt +++ b/multivimbroker/requirements.txt @@ -32,3 +32,7 @@ oslo.concurrency>=3.21.0 oslo.config>=4.11.0 oslo.service>=1.25.0 eventlet>=0.20.0 + +# uwsgi for parallel processing +uwsgi + diff --git a/multivimbroker/run.sh b/multivimbroker/run.sh index e73496f..8270deb 100755 --- a/multivimbroker/run.sh +++ b/multivimbroker/run.sh @@ -30,7 +30,8 @@ if [ "$WEB_FRAMEWORK" == "pecan" ] then python multivimbroker/scripts/api.py else - nohup python manage.py runserver 0.0.0.0:9001 2>&1 & + # nohup python manage.py runserver 0.0.0.0:9001 2>&1 & + nohup uwsgi --http :9001 --module multivimbroker.wsgi --master --processes 4 & while [ ! -f $logDir/multivimbroker.log ]; do sleep 1 diff --git a/multivimbroker/stop.sh b/multivimbroker/stop.sh index 4a2e5c3..ba0a2c8 100755 --- a/multivimbroker/stop.sh +++ b/multivimbroker/stop.sh @@ -11,4 +11,5 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -ps auxww | grep 'manage.py runserver 0.0.0.0:9001' | awk '{print $2}' | xargs kill -9 +# ps auxww | grep 'manage.py runserver 0.0.0.0:9001' | awk '{print $2}' | xargs kill -9 +ps auxww |grep 'uwsgi --http :9001 --module multivimbroker.wsgi --master' |awk '{print $2}' |xargs kill -9 -- 2.16.6