sftp并发连接

我必须设置我的服务器以接收来自不同客户端使用相同用户名的20-30个并发sftp连接。 我试图用scp来testing这个模拟用户连接。

问题是在第八次连接之后,所有其他的连接都会收到一个停顿的通知。

1)服务器上的设置将禁用任何传入连接; 2)是否有任何iptables /networking设置可能会导致这样的限制? 除了所有这些传入的连接,服务器应该处理大约100个并发的apache用户。 apache端口80连接是否与所有的sftp上传连接冲突?

该服务器是一个CentOS 5.8。

增加sshd_configMaxSessionsMaxStartups的值。

exctract: man sshd_config

 MaxSessions Specifies the maximum number of open sessions permitted per net- work connection. The default is 10. MaxStartups Specifies the maximum number of concurrent unauthenticated con- nections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10. Alternatively, random early drop can be enabled by specifying the three colon separated values ``start:rate:full'' (eg "10:30:60"). sshd(8) will refuse connection attempts with a probability of ``rate/100'' (30%) if there are currently ``start'' (10) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches ``full'' (60). 

有很多关于“scp和sftp连接失败”的post ,这似乎表明,scp客户端可能会贪婪的资源和networking,在一定程度上干涉其他连接,因此有一个解决方法是通过限制其对带宽的“攫取”来使得客户端更不积极;

  scp -l 8192 SOURCE DESTINATION 

如果这个选项允许更多的连接完成,那么你将会看到最终的解决scheme来处理每个客户端的每个连接资源。 (你可能想看看iptables速率限制,或其他stream量整形工具…),但首先你应该使用该选项运行一些testing,看看问题是否与networking资源争用直接相关。

http://www.aixmind.com/?p=1371