Date: Sun, 21 Aug 2005 23:31:01 +1000 From: Sam Lawrance <boris@brooknet.com.au> To: Divacky Roman <xdivac02@stud.fit.vutbr.cz> Cc: hackers@freebsd.org Subject: Re: number of simultanously opened files Message-ID: <1124631061.38048.14.camel@dirk.no.domain> In-Reply-To: <20050821094849.GA79907@stud.fit.vutbr.cz> References: <20050821094849.GA79907@stud.fit.vutbr.cz>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 2005-08-21 at 11:48 +0200, Divacky Roman wrote: > hi > > I wrote this: > witten /tmp# cat x.c > #include <stdio.h> > #include <fcntl.h> > #include <sys/limits.h> > > #define MAX 100000 > main() > { > int i = MAX; > > for (; i>0; i--) { > if (open("/dev/null", O_RDONLY) == -1) { > printf("FUCK: %i\n", MAX-i); > printf("FUCK: %i\n", i); > break; > } > } > getchar(); > } > > set: > > witten ~# sysctl kern.maxfiles=100000 > kern.maxfiles: 100000 -> 100000 > witten ~# sysctl kern.maxfilesperproc=100000 > kern.maxfilesperproc: 100000 -> 100000 > witten ~# > > but I still cannot open more than 7319 files simultaneously. pls can you tell > me why? Possibly because maximum open files is a per-process value that is set at process creation, and also inherited, so you won't see the change in existing processes. Try setting it before boot, or maybe restarting a login on a vty might work. Cheers Sam Sam Lawrance lawrance@FreeBSD.org ph +61 0425 228 579 boris@brooknet.com.au
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1124631061.38048.14.camel>