From 9ceeb60fbc0a05ce16728b3d557e6cbedeb52868 Mon Sep 17 00:00:00 2001 From: midoks Date: Mon, 1 Aug 2022 13:37:01 +0800 Subject: [PATCH] up --- plugins/op_waf/waf/lua/init.lua | 1 - plugins/php/versions/70/install.sh | 21 ++++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/plugins/op_waf/waf/lua/init.lua b/plugins/op_waf/waf/lua/init.lua index 231f7fe2b..61dd62774 100644 --- a/plugins/op_waf/waf/lua/init.lua +++ b/plugins/op_waf/waf/lua/init.lua @@ -222,7 +222,6 @@ function cc() -- else -- ngx.shared.limit:set(token,1,cycle) -- end --- return false -- end end diff --git a/plugins/php/versions/70/install.sh b/plugins/php/versions/70/install.sh index 991db563a..f544c3b1b 100755 --- a/plugins/php/versions/70/install.sh +++ b/plugins/php/versions/70/install.sh @@ -47,6 +47,25 @@ if [ "$IS_64BIT" == "64" ];then OPTIONS="${OPTIONS} --with-libdir=lib64" fi +# ----- cpu start ------ +if [ -z "${cpuCore}" ]; then + cpuCore="1" +fi + +if [ -f /proc/cpuinfo ];then + cpuCore=`cat /proc/cpuinfo | grep "processor" | wc -l` +fi + +MEM_INFO=$(free -m|grep Mem|awk '{printf("%.f",($2)/1024)}') +if [ "${cpuCore}" != "1" ] && [ "${MEM_INFO}" != "0" ];then + if [ "${cpuCore}" -gt "${MEM_INFO}" ];then + cpuCore="${MEM_INFO}" + fi +else + cpuCore="1" +fi +# ----- cpu end ------ + if [ ! -d $serverPath/php/70 ];then cd $sourcePath/php/php${PHP_VER} && ./configure \ --prefix=$serverPath/php/70 \ @@ -70,7 +89,7 @@ if [ ! -d $serverPath/php/70 ];then --disable-fileinfo \ $OPTIONS \ --enable-fpm - make clean && make && make install && make clean + make clean && make -j${cpuCore} && make install && make clean fi #------------------------ install end ------------------------------------#