Increasing the number of outbound TCP connections
I am developing a small test client for websockets. I am using Ubuntu 11.04 . I have read https://stackoverflow.com/questions/410616/increasing-the-maximum-number-of-tcp-ip-connections-in-linux and I have done the following
sudo sysctl -w net.ipv4.tcp_fin_timeout=10
sysctl -w net.ipv4.ip_local_port_range="1024 65535"
As I understand these are for inbound connections and not outbound.
When I type
ulimit -n
unlimited
My client and servers run on different boxes. Even with all the above I am not able to cross beyound 1000 connections from a box . If there is a different tip let me know
ANSWER I figured this by typing ulimit -a which shows all the kernel limits .
ulimit -n
unlimited
while
ulimit -a
returns the value for nofile as 1024. I set the limits in the /etc/security/limits.conffile in the format
<user> soft nofile 8192
<user> hard nofile 65000
and things worked for user
Solution 1:
I figured this by typing ulimit -a which shows all the kernel limits . ulimit -n returns unlimited while ulimit -a returns the value for nofile as 1024. I set the limits in the /etc/security/limits.conf file in the format ** soft nofile 8192 hard nofile 65000 and things worked