From 25b245b38be0ba1a850407064f6ee84867f15791 Mon Sep 17 00:00:00 2001 From: Yun Huang Date: Fri, 16 Mar 2018 14:29:47 +0800 Subject: Integrate uwsgi with django To enable parallel processing of plugin services Change-Id: I61e9934273a8448ee6a437c9832a45d1f75a7a60 Issue-ID: MULTICLOUD-187 Signed-off-by: Yun Huang --- newton/requirements.txt | 3 +++ newton/run.sh | 3 ++- newton/stop.sh | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) (limited to 'newton') diff --git a/newton/requirements.txt b/newton/requirements.txt index df84bef5..5eb0f365 100644 --- a/newton/requirements.txt +++ b/newton/requirements.txt @@ -13,6 +13,9 @@ keystoneauth1==2.19.0 #python-memcached python-memcached +#uwsgi for parallel processing +uwsgi + # for unit test coverage==4.2 mock==2.0.0 diff --git a/newton/run.sh b/newton/run.sh index 43de581f..a355cb8d 100755 --- a/newton/run.sh +++ b/newton/run.sh @@ -15,7 +15,8 @@ memcached -d -m 2048 -u root -c 1024 -p 11211 -P /tmp/memcached1.pid export PYTHONPATH=lib/share -nohup python manage.py runserver 0.0.0.0:9003 2>&1 & +#nohup python manage.py runserver 0.0.0.0:9003 2>&1 & +nohup uwsgi --http :9003 --module newton.wsgi --master --processes 4 & logDir="/var/log/onap/multicloud/openstack/newton" if [ ! -x $logDir ]; then diff --git a/newton/stop.sh b/newton/stop.sh index f743bf97..506d9965 100755 --- a/newton/stop.sh +++ b/newton/stop.sh @@ -13,5 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -ps auxww | grep 'manage.py runserver 0.0.0.0:9003' | awk '{print $2}' | xargs kill -9 +#ps auxww | grep 'manage.py runserver 0.0.0.0:9003' | awk '{print $2}' | xargs kill -9 +ps auxww |grep 'uwsgi --http :9003 --module newton.wsgi --master' |awk '{print $2}' |xargs kill -9 ps auxww | grep 'memcached -d -m 2048 -u root -c 1024 -p 11211 -P /tmp/memcached1.pid' | awk '{print $2}' | xargs kill -9 -- cgit 1.2.3-korg