LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 535|回复: 4

系统连接数设置问题

[复制链接]
发表于 2010-6-24 17:10:41 | 显示全部楼层 |阅读模式
测试ddos攻击
一、测试脚本如下:
http://packetstormsecurity.nl/DoS/juno.c

二、运行脚本如下:
在172.16.13.85上运行如下脚本:
juno 172.16.13.87 80 1000

每次在172.16.13.87的机器上运行:netstat -an | grep "SYN_RECV"| wc -l 均为256

三、系统配置如下:
1)172.16.13.87的/etc/sysctl文件的配置如下:
fs.nfs.nlm_udpport = 0
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2
##
#
net.ipv4.tcp_rmem = 4096        98304   349520
net.ipv4.tcp_wmem = 4096        65535   262142
net.ipv4.tcp_mem = 98304        262142  393216
#
net.core.rmem_max = 524288
net.core.wmem_max = 524288
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.ipv4.route.gc_thresh = 131072
net.ipv4.route.max_size = 2097152

2)apache中的相关配置如下:
Timeout 60
KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout   5


StartServers         3
MaxClients         3200
ServerLimit        32
MinSpareThreads     50
MaxSpareThreads     250
ThreadLimit   200
ThreadsPerChild     100
MaxRequestsPerChild 0


个人认为是系统的连接限制没有打开,请问系统中都有哪些涉及此方面?
发表于 2010-6-25 00:31:59 | 显示全部楼层
iptables

Refer to IpTables Manual. There is an example configure with DDoS defending.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-6-25 10:00:11 | 显示全部楼层
Post by jsun;2099046
iptables

Refer to IpTables Manual. There is an example configure with DDoS defending.


谢谢回复,其实我问的是怎样修改系统所能允许的半连接数,也就是
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
在设置后,系统所允许的半连接数不是1024,而是256的原因?
回复 支持 反对

使用道具 举报

发表于 2010-6-25 11:46:08 | 显示全部楼层
看起来是你的apache配置太小了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-6-25 11:50:16 | 显示全部楼层
Post by druggo;2099465
看起来是你的apache配置太小了


后来改成nginx了,nginx默认连接数为8192,测试结果和上面相同,而且在每次测试过程中,ssh基本 不能用,但是直接进入系统,则一节正常,所以怀疑是系统的连接数已经到了最大值
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表