aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: File handle limit  (Read 5786 times)

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
File handle limit
« 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.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: File handle limit
« Reply #1 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.
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: File handle limit
« Reply #2 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?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: File handle limit
« Reply #3 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
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: File handle limit
« Reply #4 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
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon