MT#7137 Decrease default values in config and template

1) we don't have /etc/default and/or config.yml options for old releases
2) we need to decreate some option for low performance mode
3) services should never start with default options
(otherwise oom-killer does the job and kill services)

So, we have migrated all the options to installer under special
install option and are going to decrese config _and_ template
for old releases in deployment.sh
In this case VM after first reboot will have all the options in
low performance mode and we do not need apply changes.
vseva/8067
Alexander Lutay 11 years ago
parent 84161ebda6
commit 17cad07f1c

@ -2036,18 +2036,25 @@ adjust_for_low_performance() {
echo "Decreasing default resource usage" echo "Decreasing default resource usage"
if expr $SP_VERSION \<= mr3.2.999 >/dev/null 2>&1 ; then if expr $SP_VERSION \<= mr3.2.999 >/dev/null 2>&1 ; then
# sems: need for NGCP <=mr3.2 (MT#7407) # sems: need for NGCP <=mr3.2 (MT#7407)
sed -i -e 's/media_processor_threads=[0-9]\+$/media_processor_threads=1/g' ${TARGET}/etc/ngcp-config/templates/etc/sems/sems.conf.tt2 sed -e 's/media_processor_threads=[0-9]\+$/media_processor_threads=1/g' \
-i ${TARGET}/etc/ngcp-config/templates/etc/sems/sems.conf.tt2 \
-i ${TARGET}/etc/sems/sems.conf || true
fi fi
if expr $SP_VERSION \<= 3.1 >/dev/null 2>&1 ; then if expr $SP_VERSION \<= 3.1 >/dev/null 2>&1 ; then
# kamailio: need for NGCP <=3.1 (MT#5513) # kamailio: need for NGCP <=3.1 (MT#5513)
sed -i -e 's/tcp_children=4$/tcp_children=1/g' ${TARGET}/etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.tt2 || true sed -e 's/tcp_children=4$/tcp_children=1/g' \
-i ${TARGET}/etc/ngcp-config/templates/etc/kamailio/proxy/kamailio.cfg.tt2 \
-i ${TARGET}/etc/kamailio/proxy/kamailio.cfg || true
fi fi
if expr $SP_VERSION \<= mr3.2.999 >/dev/null 2>&1 ; then if expr $SP_VERSION \<= mr3.2.999 >/dev/null 2>&1 ; then
# nginx: need for NGCP <=mr3.2 (MT#7275) # nginx: need for NGCP <=mr3.2 (MT#7275)
sed -i -e 's/NPROC=[0-9]\+$/NPROC=2/g' ${TARGET}/etc/ngcp-config/templates/etc/init.d/ngcp-panel.tt2 || true sed -e 's/NPROC=[0-9]\+$/NPROC=2/g' \
sed -i -e 's/NPROC=[0-9]\+$/NPROC=2/g' ${TARGET}/etc/ngcp-config/templates/etc/init.d/ngcp-www-csc.tt2 || true -i ${TARGET}/etc/ngcp-config/templates/etc/init.d/ngcp-panel.tt2 \
-i ${TARGET}/etc/init.d/ngcp-panel \
-i ${TARGET}/etc/ngcp-config/templates/etc/init.d/ngcp-www-csc.tt2 \
-i ${TARGET}/etc/init.d/ngcp-www-csc || true
fi fi
# record configuration file changes # record configuration file changes

Loading…
Cancel
Save