1. Modify the Yum source
Wget-o/etc/yum.repos.d/centos-base.repo Http://mirrors.aliyun.com/repo/Centos-6.repowget-O/etc/yum.repos.d/ Epel.repo Http://mirrors.aliyun.com/repo/epel-6.repo
2. Modify SELinux (to deactivate SELinux)
Sed-i.bak ' s/selinux=enforcing/selinux=disabled/'/etc/selinux/config
3. Streamlined boot-up service
Export Lang=enchkconfig|egrep-v "Crond|sshd|network|rsyslog|sysstat" |awk ' {print "Chkconfig", $, "off"} ' | Bashchkconfig--list|grep 3:on
4. English Character Set
Cp/etc/sysconfig/i18n/etc/sysconfig/i18n.oriecho ' lang= ' en_US. UTF-8 "' >/etc/sysconfig/i18nsource/etc/sysconfig/i18necho $LANG
5. Time synchronization
echo ' #time sync by Time @ 2017-7-30 ' >>/var/spool/cron/rootecho ' */5 * * * */usr/sbin/ntpdate pool.ntp.org >/d Ev/null 2>&1 ' crontab-l
6. Enlarge Document Description
Echo ' *-nofile 65535 ' >>/etc/security/limits.conf tail-1/etc/security/limits.conf
7. Kernel optimization
cat >>/etc/sysctl.conf<<eofnet.ipv4.tcp_fin_timeout = 2net.ipv4.tcp_tw_reuse = 1net.ipv4.tcp_tw_recycle = 1net.ipv4.tcp_syncookies = 1net.ipv4.tcp_keepalive_time = 600net.ipv4.ip_local_port_range = 4000 65000net.ipv4.tcp_max_syn _backlog = 16384net.ipv4.tcp_max_tw_buckets = 36000net.ipv4.route.gc_timeout = 100net.ipv4.tcp_syn_retries = 1net.ipv4.tcp_synack_retries = 1net.core.somaxconn = 16384net.core.netdev_max_backlog = 16384net.ipv4.tcp_max_orphans = 16384# The following parameters are optimized for the iptables firewall, the firewall does not meet the prompts, can be ignored. Net.nf_conntrack_max = 25000000net.netfilter.nf_conntrack_max = 25000000net.netfilter.nf_ conntrack_tcp_timeout_established = 180net.netfilter.nf_conntrack_tcp_timeout_time_wait = 120net.netfilter.nf_conntrack_tcp_timeout_close_wait = 60net.netfilter.nf_conntrack_tcp_timEout_fin_wait = 120eof
8. Make configuration effective
Sysctl-p
9. Install Common Tools
Yum Install Lrzsz nmap Tree Dos2unix NC telnet-y
10, SSH connection speed slow optimization
Sed-i.bak ' [email protected] #UseDNS [email protected] [email protected]; [Email protected]^gssapiauthentication [email protected] [email protected] '/etc/ssh/sshd_config/etc/init.d/sshd Reload
This article is from the "one small step per day" blog, so be sure to keep this source http://fenyuer.blog.51cto.com/11265169/1952395
Linux system optimization