# "too many open files"? [solved]

## __g_blade

some apps like amule azureus etc have problems with files max

always the same "error 24" too many open files.. can't open x can't open y can't open /dev/urandom etc....

is that count not enough?

```

omerta ~ # cat /proc/sys/fs/file-max

76939

```

i've read somethin about a bug with file stuff in 2.6.14 @ googled 

sorry, i'm noob

don't know how to fix the problem

that's my gentoo

```

omerta ~ # emerge --info

Portage 2.1_rc1-r3 (default-linux/x86/2006.0, gcc-4.1.1-pre20060521, glibc-2.4.90.20060511-r0, 2.6.17-rc3-no2 i686)

=================================================================

System uname: 2.6.17-rc3-no2 i686 AMD Sempron(tm) 2200+

Gentoo Base System version 1.12.0_pre19

dev-lang/python:     2.4.3-r1

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.92

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.16

ACCEPT_KEYWORDS="x86 ~x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe -ftracer -fweb -frename-registers"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/X11/xkb /usr/share/config /var/qmail/control"

CONFIG_PROTECT_MASK="/etc/eselect/compiler /etc/gconf /etc/revdep-rebuild /etc/splash /etc/terminfo /etc/env.d"

CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe -ftracer -fweb -frename-registers -fvisibility-inlines-hidden"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks metadata-transfer sandbox sfperms strict"

GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"

LDFLAGS="-Wl,-O1 -Wl,--sort-common"

LINGUAS="en fr de es it tr"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage"

SYNC="rsync://rsync.gentoo.org/gentoo-portage"

USE="x86 3dnow 3dnowext X aim alsa apache2 apic apm arts asf ati avi berkdb bidi bitmap-fonts browserplugin cli cmov crypt cups cx8 de dri eds emboss encode esd foomaticdb fortran fpu fxsr gdbm gif glibc-omitfp gnome gpm gstreamer gtk gtk2 icq imlib ipv6 irc isdnlog jabber java javascript jpeg kde libg++ libwww lj mad matroska mca mce mikmod mmx mmxext mono motif mozilla mp mp3 mpeg mpg msn msr mtrr ncurses nls nptl nptlonly nsplugin ogg opengl pae pam pat pcre pdflib perl pge png pppd pse pse36 python qt quicktime readline real reflection rss sdl sep session spell spl sse ssl syscall tcpd tiff truetype truetype-fonts ts tsc type1-fonts udev unicode up vme vorbis win32codecs xinerama xml xmms xorg xv xvid yahoo zlib elibc_glibc kernel_linux linguas_en linguas_fr linguas_de linguas_es linguas_it linguas_tr userland_GNU"

Unset:  ASFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, MAKEOPTS, PORTAGE_RSYNC_EXTRA_OPTS

```

EDIT:

SOLVED

in /etc/security/limits.conf there must be a line

USER hard nofile XXXX

replace USER with user you want to change the filesmax

replace XXXX with files-maximum, e. g. 4096

standard is 1024 i think

everything works, but this is still strange

```

ferdi@omerta ~ $ ulimit -n

1024

```

nevertheless it works  :Smile: 

----------

## Beefrum

Unless, otherwise inhibited. Current 'sys-kernel/gentoo-sources' have this setting corrected  :Very Happy: 

----------

## ppoudrier

You have to set in /etc/security/limits.conf both values :

```

User        soft        nofile        value        #(this value must be lower than the hard limit)

User        hard       nofile        value+1

```

If you want for all users, simply put "*" instead of User.

----------

## qriff

https://forums.gentoo.org/viewtopic-p-5294642.html#5294642

----------

