【Linux优化】Linux安装之后的优化
yum source config
mv /etc/yum.repos.d/CentOS-Base.repo{,.bkp}
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
yum makecache
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
update
ll /etc/pki/rpm-gpg/
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
yum update -y
Close SELinux
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
setenforce 0
getenforce
#Permissive
Close services
for oldboy in `chkconfig --list|grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $oldboy off;done
chkconfig --list|grep 3:on
for oldboy in crond network rsyslog sshd sysstat;do chkconfig --level 3 $oldboy on;done
chkconfig --list|grep 3:on
for oldboy in `chkconfig --list|grep "3:on"|awk '{print $1}'|grep -vE "crond|network|sshd|rsyslog|sysstat"`;do
chkconfig $oldboy off;done
chkconfig --list|grep 3:on|grep -vE "crond|sshd|network|rsyslog|sysstat"|awk '{print "chkconfig " $1 " off"}'|bash
Close firewall
/etc/init.d/iptables stop
chkconfig iptables off
Charset
cp /etc/sysconfig/i18n{,.bkp}
echo 'LANG="zh_CN.UTF-8"' >/etc/sysconfig/i18n
sync time
/usr/sbin/ntpdate time.nist.gov
echo '#Time sync by william at 2018-04-05' >>/var/spool/cron/root
echo '*/5 * * * * /usr/sbin/ntpdate time.nist.gov > /dev/null >&1' >> /var/spool/cron/root
HIstory Set
export TMOUT=100
export HISTSIZE=100
export HISTFILESIZE=5
echo 'export TMOUT=100' >>/etc/profile
echo 'export HISTSIZE=100' >>/etc/profile
echo 'export HISTFILESIZE=5'>>/etc/profile
source /etc/profile
echo "unset MAILCHECK" >>/etc/profile
source /etc/profile
cat /dev/null > /var/spool/mail/root
ulimit -n
#65535
echo '* - nofile 65535' >>/etc/security/limits.conf
Sec
chattr +i /etc/passwd
chattr +i /etc/inittab
chattr +i /etc/group
chattr +i /etc/shadow
chattr +i /etc/gshadow
lsattr /etc/passwd
find /var/spool/postfix/maildrop/ -type f|xargs rm -f
>/etc/issue
>/etc/issue.net
grup
/sbin/grub-md5-crypt
password --md5 $1$hmiFo/$GgaI7QZUFJMeMTvgUCUfp/
core
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl =15
net.ipv4.tcp_retries2 = 5
net.ipv4.tcp_fin_timeout = 2
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_orphans = 32768
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_wmem = 8192 131072 16777216
net.ipv4.tcp_rmem = 32768 131072 16777216
net.ipv4.tcp_mem = 786432 1048576 1572864
net.ipv4.ip_local_port_range = 1024 65000
net.ipv4.ip_conntrack_max = 65536
net.ipv4.netfilter.ip_conntrack_max=65536
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established=180
net.core.somaxconn = 16384
net.core.netdev_max_backlog = 16384
net.ipv4.ip_conntrack_max = 25000000
net.ipv4.netfilter.ip_conntrack_max = 25000000
net.ipv4.netfilter.ip_conntrack_tcp_timeout_established = 180
net.ipv4.netfilter.ip_conntrack_tcp_timeout_time_wait = 120
net.ipv4.netfilter.ip_conntrack_tcp_timeout_close_wait = 60
net.ipv4.netfilter.ip_conntrack_tcp_timeout_fin_wait = 120
【Linux优化】Linux安装之后的优化的更多相关文章
- Arch linux(UEFI+GPT)安装及后续优化教程
Arch Linux安装过程中需要从远程存储库获取软件包,电脑需要有效的互联网连接. 1.联网 查看是否有网 ping www.baidu.com 同步时间 timedatectl set-ntp t ...
- 1.linux服务器的性能分析与优化
[教程主题]:1.linux服务器的性能分析与优化 [课程录制]: 创E [主要内容] [1]影响Linux服务器性能的因素 操作系统级 CPU 目前大部分CPU在同一时间只能运行一个线程,超线程的处 ...
- 高性能Linux服务器 第10章 基于Linux服务器的性能分析与优化
高性能Linux服务器 第10章 基于Linux服务器的性能分析与优化 作为一名Linux系统管理员,最主要的工作是优化系统配置,使应用在系统上以最优的状态运行.但硬件问题.软件问题.网络环境等 ...
- 优化Linux内核参数/etc/sysctl.conf sysctl 《高性能Linux服务器构建实战:运维监控、性能调优与集群应用》
优化Linux内核参数/etc/sysctl.conf sysctl <高性能Linux服务器构建实战:运维监控.性能调优与集群应用> http://book.51cto.com/ar ...
- linux服务器的性能分析与优化(十三)
[教程主题]:1.linux服务器的性能分析与优化 [主要内容] [1]影响Linux服务器性能的因素 操作系统级 Ø CPU 目前大部分CPU在同一时间只能运行一个线程,超线程的处理器可以在同一时间 ...
- Nginx优化指南+LINUX内核优化+linux连接数优化+nginx连接数优化
Most setup guides for Nginx tell you the basics - apt-get a package, modify a few lines here and the ...
- 优化Linux生产服务器的经验之谈
[51CTO独家特稿]如何优化自己的Linux生产服务器?本文结合实际的工作经验,总结了优化Linux生产服务器的九大要点.如果有些方法您尚未采用,不妨一试. 一.时间同步 生产环境下的服务器对时间的 ...
- Linux(Centos )的网络内核参数优化来提高服务器并发处理能力【转】
简介 提高服务器性能有很多方法,比如划分图片服务器,主从数据库服务器,和网站服务器在服务器.但是硬件资源额定有限的情况下,最大的压榨服务器的性能,提高服务器的并发处理能力,是很多运维技术人员思考的问题 ...
- 通过/proc/sys/net/ipv4/优化Linux下网络性能
通过/proc/sys/net/ipv4/优化Linux下网络性能 /proc/sys/net/ipv4/优化1) /proc/sys/net/ipv4/ip_forward该文件表示是否打 ...
- (转)/etc/sysctl.conf 调优 & 优化Linux内核参数
/etc/sysctl.conf 调优 & 优化Linux内核参数 from: http://apps.hi.baidu.com/share/detail/15652067 http://ke ...
随机推荐
- python float转为decimal
73.2413793103 ======= 73.2414 <type 'float'> ======= <class 'decimal.Decimal'> 当断言这两个值相等 ...
- C#读取text内容并且于testbox中展现 保留换行实现方法
直接上代码 //新建一个储存的list List<string> listLines = new List<string>(); StreamReader sr = new S ...
- missing seperator error when [make all]
https://stackoverflow.com/questions/16931770/makefile4-missing-separator-stop makefile has a very st ...
- nginx ----> nginx配置/反向代理/负载均衡
nginx [engine x]是一个HTTP和反向代理服务器,一个邮件代理服务器和一个通用的TCP/UDP代理服务器,最初由Igor Sysoev编写. 环境: Ubuntu16.04 安装ngin ...
- 时钟中断TIMER_BH(bottom_half)实现分析
017-12-6 16:27:35时钟中断TIMER_BH(bottom_half)实现分析1.3.1001. 时钟0号中断安装 setup_x86_irq(0, &irq0);@arc ...
- CF-831D Office Keys 思维题
http://codeforces.com/contest/831/problem/D 题目大意是在一条坐标轴上,给出n个人,k把钥匙(k>=n)以及终点的坐标,所有人都可以同时运动,但不可以公 ...
- Forbidden Subwords
pro: sol: 建出ac自动机. 一个合法的答案对应一条路径满足从一个scc走到另一个scc的路径. 发现这个题的方案数有可能是无限的. 会在以下两种情况无限: 因此,去掉无限情况后,环只有简单环 ...
- 21. Merge Two Sorted Lists (Java 合并有序链表 空间复杂度O(1))
题目: Merge two sorted linked lists and return it as a new list. The new list should be made by splici ...
- FileZilla 客户端连接 FlieZilla 服务器 连接成功读取目录列表却失败的解决办法
解决过程: 第一步: 第二步:
- 2017-2018 ACM-ICPC, NEERC, Northern Subregional ContestG - Grand Test
题意:找三条同起点同终点的不相交的路径 题解:用tarjan的思想,记录两个low表示最小和次小的dfs序,以及最小和次小的位置,如果次小的dfs序比dfn小,那么说明有两条返祖边,那么就是满足条件的 ...