huangfen2002 发表于 2015-9-3 11:05:37

[导入]调整linux和squid的性能

1。linux内核调整:


net.ipv4.ip_local_port_range = 1024 65536
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 3
net.ipv4.tcp_tw_recycle = 1
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.core.somaxconn = 262144
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2


2。调整文件描述符_ _FD_SETSIZE得大小
修改/usr/include/linux/posix_types.h



#undef __FD_SETSIZE
#define __FD_SETSIZE 1024

修改为



#undef __FD_SETSIZE
#define __FD_SETSIZE 10240


修改/usr/include/bits/typesizes.h



#define __FD_SETSIZE            1024修改为


#define __FD_SETSIZE            10240


3。调整ulimit:
只对


ulimit -HSn 10240


4。增加同一shell里处理得文件描述符限制数



echo 10240 > /proc/sys/fs/file-max

------------------EOF--------------------


Tags - linux , squid , 性能优化
文章来源:http://www.askwan.com/read.php?60
页: [1]
查看完整版本: [导入]调整linux和squid的性能