Created
February 26, 2021 01:56
-
-
Save linuxmalaysia/11de0593cb6d1cc13640f4a31c78fb72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ==== | |
| Ref: https://www.vultr.com/docs/how-to-deploy-google-bbr-on-centos-7 | |
| yum install byobu openssh fail2ban httpd | |
| rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org | |
| yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm | |
| yum --enablerepo=elrepo-kernel install kernel-ml -y | |
| sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \' | |
| (0 kerana kernel tu baris pertama, jika baris 2 tukar 1) | |
| sudo grub2-set-default 0 | |
| masukkan sysctl.conf | |
| # https://bl.ocks.org/magnetikonline/2760f98f6bf654d5ad79 | |
| vm.max_map_count=262144 | |
| #Untuk large file transfer | |
| # Increase size of file handles and inode cache | |
| fs.file-max = 3261780 | |
| # increase TCP max buffer size | |
| net.core.rmem_max = 16777216 | |
| net.core.wmem_max = 16777216 | |
| # increase Linux autotuning TCP buffer limits | |
| # min, default, and max number of bytes to use | |
| # per-socket receive/send buffers for TCP [min default max] | |
| net.ipv4.tcp_rmem = 4096 12582912 16777216 | |
| net.ipv4.tcp_wmem = 4096 12582912 16777216 | |
| #net.ipv4.tcp_rmem = 4096 87380 16777216 | |
| #net.ipv4.tcp_wmem = 4096 65536 16777216 | |
| #net.ipv4.tcp_rmem = 4096 16060 262144 | |
| #net.ipv4.tcp_wmem = 4096 16384 262144 | |
| # don't cache ssthresh from previous connection | |
| net.ipv4.tcp_no_metrics_save = 1 | |
| # Do less swapping | |
| vm.swappiness = 1 | |
| # Linux TCP BBR congestion control | |
| #net.core.default_qdisc=fq | |
| # bbr + fq_codel for kernel >= 4.13 | |
| net.core.default_qdisc = fq_codel | |
| net.ipv4.tcp_congestion_control=bbr | |
| ###net.ipv4.tcp_notsent_lowat = 16384 | |
| net.ipv4.tcp_mtu_probing=1 | |
| # Example server: 8 cores | |
| net.core.netdev_max_backlog = 32768 | |
| # SYN Backlog Queue, number of half-open connections | |
| net.ipv4.tcp_max_syn_backlog = 32768 | |
| # Accept Queue Limit, maximum number of established | |
| # connections waiting for accept() per listener. | |
| net.core.somaxconn = 65535 | |
| # Maximum number of SYN and SYN+ACK retries before | |
| # packet expires. | |
| net.ipv4.tcp_syn_retries = 1 | |
| net.ipv4.tcp_synack_retries = 1 | |
| # Timeout in seconds to close client connections in | |
| # TIME_WAIT after receiving FIN packet. | |
| net.ipv4.tcp_fin_timeout = 30 | |
| # Disable SYN cookie flood protection | |
| net.ipv4.tcp_syncookies = 0 | |
| # port range used by TCP and UDP to choose the local port | |
| # default: net.ipv4.ip_local_port_range = 32768 60999 | |
| net.ipv4.ip_local_port_range = 1024 61000 | |
| # various timewait socket setting tweaks | |
| net.ipv4.tcp_tw_reuse = 1 | |
| net.ipv4.tcp_max_tw_buckets = 400000 | |
| net.ipv4.tcp_max_orphans = 60000 | |
| ==== | |
| /etc/security/limits.conf | |
| apache soft nofile 64000 | |
| apache hard nofile 64000 | |
| apache soft nproc 64000 | |
| apache hard nproc 64000 | |
| ==== | |
| /etc/sysconfig/memcached | |
| PORT="11211" | |
| USER="memcached" | |
| MAXCONN="8192" | |
| CACHESIZE="16384" | |
| OPTIONS="-l 127.0.0.1 -U 0" | |
| ==== | |
| yum -y install libhugetlbfs libhugetlbfs-utils | |
| hugeadm --page-sizes-all | |
| hugeadm --page-sizes | |
| grep Hugepagesize /proc/meminfo | |
| hugeadm --list-all-mounts | |
| hugeadm --pool-list | |
| hugeadm --pool-pages-min 2MB:4096 | |
| hugeadm --pool-pages-max 2MB:12850 | |
| hugeadm --pool-list | |
| ==== | |
| DISABLED | |
| echo never > /sys/kernel/mm/transparent_hugepage/enabled | |
| echo never > /sys/kernel/mm/transparent_hugepage/defrag | |
| === |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment