CentOS 5.6 Linux安装系统后的基本优化

首页 → Linux教程

背景:

阅读新闻

CentOS 5.6 Linux安装系统后的基本优化

[日期:2012-02-17]来源:Linux社区作者:firefoxbug[字体:]

1.关闭不必要的服务器

#ntsysv

保留

crond

Linux计划任务服务

irqbalance

用于优化中断分配,,以充分利用CPU 多核

network

sshd

syslog

Linux 日志系统(重要)

2关闭iptables

#services iptables stop && chkconfig iptables off

关闭SELinux

#vim /etc/selinux/config

将文件中的selinux=””改为 desabled ,并重启

使用setenforce 0 可以不需要重启关闭SELinux 但是重启后失效

3.关闭不需要的tty

#vim /etc/inittab

# Run gettys in standard runlevels1:2345:respawn:/sbin/mingetty tty12:2345:respawn:/sbin/mingetty tty23:2345:respawn:/sbin/mingetty tty34:2345:respawn:/sbin/mingetty tty45:2345:respawn:/sbin/mingetty tty56:2345:respawn:/sbin/mingetty tty6

注释掉后4 个控制台 并执行 init q 命令生效

4.停止打印服务

#/etc/init.d/cups stop

#chkconfig cups off

5.关闭ipv6

#vim /etc/modprobe.conf

添加内容

alias net-pf-10 off

alias ipv6 off

保存退出

#echo “IPV6INIT = no” >>/etc/sysconfig/network-scripts/ifcfg-eth0

#reboot 重启生效

6.调整Linux 的最大文件打开数

#vim /etc/rc.d/rc.local

添加内容

ulimit -SHn 65565

7关闭CentOS的写磁盘I/O功能

一个linux文件默认有3个时间

atime:对此文件的访问时间

ctime: 此文件的inode发生变化的时间

mtime: 此文件的修改时间

#vim /etc/fstab

/dev/sda2 /data ext3 noatime,nodiratime 0 0

8,优化Linux 下的内核tcp 参数以提高系统性能

#vim /etc/sysctl.config

添加内容

net.ipv4.tcp_fin_timeout = 30

net.ipv4.tcp_keepalive_time = 1200

net.ipv4.tcp_syncookise = 1

net.ipv4.tcp_tw_reuse = 1

net.ipv4.tcp_tw_recycle = 1

net.ipv4.ip_local_port_range = 1024 65000

net.ipv4.tcp_nax_syn_backlog = 8192

net.ipv4.tcp_max_tw_buckets = 5000

#sysctl -p 生效

0

Windows 7+Fedora 16启动项问题

Ubuntu 12.04全新锁定屏幕曝光

相关资讯 CentOS基础教程

CentOS编译PHP5过程中常见错误信息 (05月27日)CentOS修改用户最大进程数 (03/01/2013 21:22:42)

图片资讯

本文评论  查看全部评论 (0)

评论声明

最新资讯

本周热门

Linux公社简介 – 广告服务 – 网站地图 – 帮助信息 – 联系我们本站(LinuxIDC)所刊载文章不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。Copyright © 2006-2014 Linux公社 All rights reserved 浙ICP备06018118号

这种精神使人能在旅行中和大自然更加接近,

CentOS 5.6 Linux安装系统后的基本优化

相关文章:

你感兴趣的文章:

标签云: