debian 内存优化精简

网上copy来的命令:

apt-get -y purge apache2-* bind9-* xinetd samba-* nscd-* portmap sendmail-* sasl2-bin
apt-get -y purge lynx memtester unixodbc python-* odbcinst-* sudo tcpdump ttf-*
apt-get remove acpi acpi-support-base acpid eject man-db manpages nano vim laptop-detect bsdmainutils busybox dmidecode4
apt-get install automake wget zip unzip make time
pdksh 替代 bash
apt-get install pdkshchsh -s /bin/pdksh
//sudo apt-get install pdksh
//chsh -s /bin/pdksh
用 Dropbear 替代 OpenSSH
touch /etc/ssh/sshd_not_to_be_run
apt-get install dropbear
vi /etc/default/dropbear
/etc/init.d/dropbear start
syslog-ng 替代 rsyslog
apt-get install sysklogd && dpkg –purge rsyslog
apt-get autoremove && apt-get clean

数据库mysql优化:
wget http://www.day32.com/MySQL/tuning-primer.sh
chmod 755 tuning-primer.sh
sh tuning-primer.sh
http://www.unxmail.com/wp-content/uploads/2009/07/my-lxadmin-centos.cnf 文件内容:

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K
skip-bdb
skip-innodb
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
#safe-updates
[isamchk]
key_buffer = 8M
sort_buffer_size = 8M
[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M
[mysqlhotcopy]
interactive-timeout

更改名字为my.cnf 覆盖 /etc/my.cnf 文件,然后重新启动mysql数据库

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据