| Server IP : 104.129.129.72 / Your IP : 216.73.216.229 Web Server : LiteSpeed System : Linux 123answers 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 User : answe8064 ( 1002) PHP Version : 8.2.28 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /opt/installer/tweaks/ |
Upload File : |
#!/bin/bash
# Add this at the begining of all scripts.
if [ -f "include/startup.sh" ]; then
. include/startup.sh
elif [ -f "../include/startup.sh" ]; then
. ../include/startup.sh
fi
runOnceCheck
echo "stabilize and optimize system for mongodb" | log
# manual:
# mount / -o remount,defaults,noatime
sed -i '/\s\/\s/ s/defaults/defaults,noatime/' /etc/fstab
# manual:
# echo 'never' > /sys/kernel/mm/transparent_hugepage/enabled
# echo 'never' > /sys/kernel/mm/transparent_hugepage/defrag
cp $rootDir/tweaks/extras/mongodb/disable-transparent-hugepages /etc/init.d/
chmod 755 /etc/init.d/disable-transparent-hugepages
update-rc.d disable-transparent-hugepages defaults
# manual:
# blockdev --setra 0 /dev/sda
cp $rootDir/tweaks/extras/mongodb/zero-readahead /etc/init.d/
chmod 755 /etc/init.d/zero-readahead
update-rc.d zero-readahead defaults
echo "Restaring service" | log
systemctl restart mongod.service
waitOrStop 0 "Restart mongod service failed"
tagScript success
exit 0