[IRCServices Coding] A bit more on FD limits (not strictly services-related)

Martin Pels martinpels at hotmail.com
Wed Jun 5 04:57:15 PDT 2002


I restarted services with httpd disabled, to see if that helps. but the
problem persists :-(

/proc/sys/fs/file-nr gives me 1864    136     4096
so only 136 in use...

I did notice this in the log when restarting Services:

[Jun 05 13:25:12 2002] IRC Services 5.0pre1 starting up
[Jun 05 13:25:13 2002] sockets: [v]sockprintf() with NULL socket!

----- Original Message -----
From: "Russell Garrett" <rg at tcslon.com>
To: <ircservices-coding at ircservices.za.net>
Sent: Wednesday, June 05, 2002 1:39 PM
Subject: [IRCServices Coding] A bit more on FD limits (not strictly
services-related)


> OK, I've done a touch more research on this, the Linux default is
> maximum 1024 FDs per process, and 4096 in total. A `cat
> /proc/sys/fs/file-nr` will tell you the number of open FDs, the
> number in use, and the maximum limit.
>
> To increase the maximum number of FDs to 65536 (for a 2.2 kernel - I
> think 2.4 is the same):
>
> 1. In /usr/include/bits/types.h change the "#define __FD_SETZISE
> 1024" to "#define __FD_SETSIZE 65536"
> 2. Do the same in /usr/include/linux/posix_types.h
> 3. Recompile your kernel
>
> The following steps need to be performed every time you start the
> FD-hungry application, or in your init scripts:
>
> 4. echo "65536" > /proc/sys/fs/file_max
> 5. echo "196608" > /proc/sys/fs/inode_max
> 6. ulimit -HSn 65536
>
> Russ Garrett
> russ at garrett.co.uk
> www.faereal.net
>
> ------------------------------------------------------------------
> To unsubscribe or change your subscription options, visit:
> http://www.ircservices.za.net/mailman/listinfo/ircservices-coding
>