aMule Forum

English => en_Linux => Topic started by: Stu Redman on April 23, 2009, 10:31:54 PM

Title: File handle limit
Post by: Stu Redman on April 23, 2009, 10:31:54 PM
I just tried increasing number of file handles on Ubuntu Intrepid and couldn't do it. ulimit -n says
Code: [Select]
me@hardy:~$ ulimit -n
1024
me@hardy:~$ ulimit -n 1200
bash: ulimit: open files: cannot modify limit: Operation not permitted
me@hardy:~$

Am I missing something? If that's a fact we should rethink our concept of keeping a file handle open for each temp file, even if paused.
Title: Re: File handle limit
Post by: wuischke on April 23, 2009, 11:11:39 PM
There are soft limits and hard limits. A user can modify the soft limit (try setting it to 512, it should work), but the hard limits can only be set by root. Your hard limit is 1024, therefore you can't set the soft limit higher than 1024.
Title: Re: File handle limit
Post by: Stu Redman on April 23, 2009, 11:23:38 PM
Okay, works. Thank you!
Now the problem remains: change applies to the current shell, so su / ulimit / exit doesn't work, only su / ulimit / su user , which is not exactly elegant. Any way to set it persistant?
Title: Re: File handle limit
Post by: wuischke on April 24, 2009, 06:59:12 AM
Have a look at the /etc/security/limits.conf file. The option is called "nofile", the method is explained for instance at http://www.debian.org/doc/manuals/securing-debian-howto/ch4.en.html#s-user-limits
Title: Re: File handle limit
Post by: Stu Redman on April 24, 2009, 10:13:17 PM
There are only comments in the file. I've added a

*   -   nofile   20000

and rebooted - Bingo. Thank you!  :D