I am using an ubuntu openssh server to allow users to connect to and do dynamic port forwarding. the performance is good until about 100 users are connected. beyond that the performance is dropped too much. actually establishing new tcp connections take too much time, but when they are established the speed is good.

my configurations are like below:

fs.file-max = 60000
net.core.somaxconn = 8000
net.core.netdev_max_backlog = 8000
net.ipv4.tcp_max_syn_backlog = 8000
net.ipv4.ip_local_port_range = 10000 65000

* soft nofile 60000
* hard nofile 60000
root soft nofile 60000
root hard nofile 60000

when about 150 users are connected:
the cpu usage is 10%
ram usage is 50%
bandwidth usage is 30mbs
netstat -n | wc -l shows 7500
lsof | wc -l shows 36000

I think this is something related to kernel or software limitations which cause this performance drop, any idea?

please don't suggest using proxy or vpn instead.

closed as too localized by Michael Hampton, mdpc, mgorven, Jay, Kenny Rasschaert Mar 24 '13 at 11:46

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. If this question can be reworded to fit the rules in the help center, please edit the question.

  • What exactly are you trying to accomplish? SSH is not designed to be used as a port-bouncer, and banging nails with a screwdriver is never going to be particularly efficient... – voretaq7 Mar 21 '13 at 5:31