7

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

  • What I/O discovery method are you using? Is it select, poll, epoll, thread per connection, process pool, or what? And what goes wrong when you try to go over 1,000 connections? – David Schwartz Feb 18 '12 at 06:16
  • I am using node.js socket.io-client . This internally is using a thread most probably . There is no error . netstat on the client and the server shows there are 1019 connections in the ESTABLISHED state There are no error messages on the client or on the server – Harihara Vinayakaram Feb 18 '12 at 07:12
  • Are you sure you're typing `ulimit -n` from the exact same context in which node.js is launched? – David Schwartz Feb 18 '12 at 07:22
  • 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 – Harihara Vinayakaram Feb 18 '12 at 10:36

1 Answers1

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