【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 ...
随机推荐
- 雷林鹏分享:XML Parser
XML Parser 所有现代浏览器都有内建的 XML 解析器. XML 解析器把 XML 文档转换为 XML DOM 对象 - 可通过 JavaScript 操作的对象. 解析 XML 文档 下面的 ...
- 质控工具之cutadapt的使用方法
cutadapt 参考:用cutadapt软件来对双端测序数据去除接头 fastqc可以用于检测,检测出来了怎么办? 看了几篇高水平文章,有不少再用cutadapt,虽然有时候数据真的不错,但是还是要 ...
- http bass
1.http 是超文本传输协议,是从万维网服务器传输超文本到本地浏览器的传输协议 2.http是一个基于tcp/ip通信协议来传输数据(html,图片,查询结果等) 3.一个完整的http请求包含7个 ...
- Alyona and a tree CodeForces - 739B (线段树合并)
大意: 给定有根树, 每个点$x$有权值$a_x$, 对于每个点$x$, 求出$x$子树内所有点$y$, 需要满足$dist(x,y)<=a_y$. 刚开始想错了, 直接打线段树合并了..... ...
- Python 向列表中添加元素
向列表中添加元素 1.append tabulation1.append('紫霞') ['大圣', '天蓬', '卷帘', '紫霞', '紫霞', '青霞'] 2.insert tabulation1 ...
- springboot项目线程使用
下面是一个demo: public class TestThread { private static int nThreads =Runtime.getRuntime().availableProc ...
- acl使用示例
declare v_count number; uprinciple varchar2(20); principle varchar2(20); begin uprinciple := ...
- Oracle中的instr()函数 详解及应用
1)instr()函数的格式 (俗称:字符查找函数) 格式一:instr( string1, string2 ) / instr(源字符串, 目标字符串) 格式二:instr( strin ...
- OCP知识点讲解 之 检查点队列与增量检查点
原创 http://blog.chinaunix.net/uid-26762723-id-3271558.html 检查点的主要目的是以对数据库的日常操作影响最小的方式刷新脏块.脏块不断的产生,如何将 ...
- 一、集合框架(关于ArrayList,LinkedList,HashSet,LinkedHashSet,TreeSet)
一.ArrayList 解决了数组的局限性,最常见的容器类,ArrayList容器的容量capacity会随着对象的增加,自动增长.不会出现数组边界的问题. package collection; ...