From 35f1d7966bca1ce1140250b6949b56d2e90e99b7 Mon Sep 17 00:00:00 2001 From: Stewart Bennell Date: Fri, 29 May 2020 21:52:30 +1000 Subject: [PATCH] Create notes for me --- notes for me | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 notes for me diff --git a/notes for me b/notes for me new file mode 100644 index 0000000..b32467b --- /dev/null +++ b/notes for me @@ -0,0 +1,48 @@ +## Bugfix: reserve 512MB memory for system +echo "vm.min_free_kbytes = 524288" >> /etc/sysctl.conf +sysctl -p + +## Increase max user watches +# BUG FIX : No space left on device +echo 1048576 > /proc/sys/fs/inotify/max_user_watches +echo "fs.inotify.max_user_watches=1048576" >> /etc/sysctl.conf +sysctl -p /etc/sysctl.conf + +## Increase max FD limit / ulimit +cat <> /etc/security/limits.conf +# eXtremeSHOK.com Increase max FD limit / ulimit +* soft nproc 256000 +* hard nproc 256000 +* soft nofile 256000 +* hard nofile 256000 +root soft nproc 256000 +root hard nproc 256000 +root soft nofile 256000 +root hard nofile 256000 +EOF + +## Enable TCP BBR congestion control +cat < /etc/sysctl.d/10-kernel-bbr.conf +# eXtremeSHOK.com +# TCP BBR congestion control +net.core.default_qdisc=fq +net.ipv4.tcp_congestion_control=bbr +EOF + +## Increase kernel max Key limit +cat < /etc/sysctl.d/60-maxkeys.conf +# eXtremeSHOK.com +# Increase kernel max Key limit +kernel.keys.root_maxkeys=1000000 +kernel.keys.maxkeys=1000000 +EOF + +## Set systemd ulimits +echo "DefaultLimitNOFILE=256000" >> /etc/systemd/system.conf +echo "DefaultLimitNOFILE=256000" >> /etc/systemd/user.conf +echo 'session required pam_limits.so' | tee -a /etc/pam.d/common-session-noninteractive +echo 'session required pam_limits.so' | tee -a /etc/pam.d/common-session +echo 'session required pam_limits.so' | tee -a /etc/pam.d/runuser-l + +## Set ulimit for the shell user +cd ~ && echo "ulimit -n 256000" >> .bashrc ; echo "ulimit -n 256000" >> .profile