tags:

views:

132

answers:

4

And i will run a java app using nohup ... &

The setting must affect on this.

A: 
ulimit -n

can modify per process settings and

/proc/sys/fs/file-max

or the sysctl variable called fs.file-max can be used to read and set the system-wide value

ptman
cat /proc/sys/fs/file-max is 169203,but ulimit -n is 1024
bruce dou
+1  A: 

you can add fs.file-max = <your number> into /etc/sysctl.conf. Then reboot.

ghostdog74
cat /proc/sys/fs/file-max is 169203,but ulimit -n is 1024
bruce dou
A: 

You can use ulimit for this:

http://bloggerdigest.blogspot.com/2006/10/purpose-of-ulimit-linux-command.html

Although you should make sure that opening so many file handles is absolutely necessary before resorting to such adjustments. Increasing the maximum file handles just because you have forgotten to do an inputstream.close() in a loop is only going to delay the underlying problem.

seanhodges
I want to connect to lots of clients
bruce dou
A: 

vi ~/.bashrc And add a line at the end of file

ulimit -n 169203
bruce dou