I posted the following message to misc@ last May 31 but got no replies. The problem has gotten worse, even though I've now raised
kern.maxfiles=16384 kern.maxvnodes=16384. Here is the original message, with a current dmesg and /etc/sysctl.conf: Hi all, This morning httpd was failing to deliver files because of a "too many open files" error. I'd previously bumped kern.maxfiles from the default 1772 to 2048 and kern.maxvnodes from its default 1310 to 2048, so this morning I doubled them both to 4096. But, I'm just plucking these numbers from air. Can someone point me in the general vicinity of a procedure to correctly size these and other parameters? This is a moderately busy web server, but its load is increasing. I saw in the archives that this would be a temporary fix unless I brought the file usage pigs under control. In our case this morning, the pig was httpd with over 1200 open files. Stopping and restarting apache dropped that down to 168, but in the last hour that number had already grown to 324. I'm headed to the apache docs to see if I can figure out how to keep apache under control, but any pointers there would be greatly appreciated, too. Thanks, Jeff Ross OpenBSD 3.7-current (GENERIC) #1: Fri Jul 15 17:06:01 MDT 2005 [EMAIL PROTECTED]:/usr/src/sys/arch/i386/compile/GENERIC cpu0: Intel(R) Xeon(TM) CPU 2.66GHz ("GenuineIntel" 686-class) 2.67 GHz cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CF LUSH,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,CNXT-ID real mem = 2147000320 (2096680K) avail mem = 1953148928 (1907372K) using 4278 buffers containing 107454464 bytes (104936K) of memory mainbus0 (root) bios0 at mainbus0: AT/286+(00) BIOS, date 02/04/03, BIOS32 rev. 0 @ 0xf0010 pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000 pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf2fb0/256 (14 entries) pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82801CA LPC" rev 0x00) pcibios0: PCI bus #4 is the last bus bios0: ROM list: 0xc0000/0x8000 0xc8000/0x1000 0xc9800/0x800 0xca000/0x1800 cpu0 at mainbus0 pci0 at mainbus0 bus 0: configuration mode 1 (no bios) pchb0 at pci0 dev 0 function 0 "Intel E7501 MCH Host" rev 0x01 ppb0 at pci0 dev 2 function 0 "Intel E7500 MCH" rev 0x01 pci1 at ppb0 bus 1 "Intel 82870P2 IOxAPIC" rev 0x04 at pci1 dev 28 function 0 not configured ppb1 at pci1 dev 29 function 0 "Intel 82870P2 PCI-PCI" rev 0x04 pci2 at ppb1 bus 2 em0 at pci2 dev 1 function 0 "Intel PRO/1000MT (82545EM)" rev 0x01: irq 10, addr ess: 00:e0:81:28:e9:71 "Intel 82870P2 IOxAPIC" rev 0x04 at pci1 dev 30 function 0 not configured ppb2 at pci1 dev 31 function 0 "Intel 82870P2 PCI-PCI" rev 0x04 pci3 at ppb2 bus 3 ahc1 at pci3 dev 3 function 0 "Adaptec AHA-29160 U160" rev 0x02: irq 10 scsibus0 at ahc1: 16 targets st0 at scsibus0 targ 6 lun 0: <SEAGATE, DAT 9SP40-000, 910B> SCSI3 1/sequential removable st0: density code 0x26, 512-byte blocks, write-enabled twe0 at pci3 dev 6 function 0 "3ware Escalade IDE RAID" rev 0x01: irq 10 twe0: Escalade V1.3 scsibus1 at twe0: 16 targets sd0 at scsibus1 targ 0 lun 0: <3WARE, Host drive #00, > SCSI2 0/direct fixed sd0: 117799MB, 15017 cyl, 255 head, 63 sec, 512 bytes/sec, 241252672 sec total sd1 at scsibus1 targ 2 lun 0: <3WARE, Host drive #02, > SCSI2 0/direct fixed sd1: 117799MB, 15017 cyl, 255 head, 63 sec, 512 bytes/sec, 241252672 sec total uhci0 at pci0 dev 29 function 0 "Intel 82801CA/CAM USB" rev 0x02: irq 10 usb0 at uhci0: USB revision 1.0 uhub0 at usb0 uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1uhub0: 2 ports with 2 removable, self powered uhci1 at pci0 dev 29 function 1 "Intel 82801CA/CAM USB" rev 0x02: irq 9 usb1 at uhci1: USB revision 1.0 uhub1 at usb1 uhub1: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub1: 2 ports with 2 removable, self powered uhci2 at pci0 dev 29 function 2 "Intel 82801CA/CAM USB" rev 0x02: irq 11 usb2 at uhci2: USB revision 1.0 uhub2 at usb2 uhub2: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1 uhub2: 2 ports with 2 removable, self powered ppb3 at pci0 dev 30 function 0 "Intel 82801BA AGP" rev 0x42 pci4 at ppb3 bus 4 fxp0 at pci4 dev 1 function 0 "Intel 82557" rev 0x10, i82551: irq 5, address 00: e0:81:28:e9:70 inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 4 vga1 at pci4 dev 2 function 0 "ATI Rage XL" rev 0x27 wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation) wsdisplay0: screen 1-5 added (80x25, vt100 emulation) fxp1 at pci4 dev 3 function 0 "Intel 82557" rev 0x05, i82558: irq 11, address 00 :90:27:2a:33:a6 inphy1 at fxp1 phy 1: i82555 10/100 PHY, rev. 0 ichpcib0 at pci0 dev 31 function 0 "Intel 82801CA LPC" rev 0x02 pciide0 at pci0 dev 31 function 1 "Intel 82801CA IDE" rev 0x02: DMA, channel 0 c onfigured to compatibility, channel 1 configured to compatibility pciide0: channel 0 disabled (no drives) atapiscsi0 at pciide0 channel 1 drive 1 scsibus2 at atapiscsi0: 2 targets cd0 at scsibus2 targ 0 lun 0: <_NEC, DVD+RW ND-1100A, 1.A0> SCSI0 5/cdrom remova ble cd0(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 2 "Intel 82801CA/CAM SMBus" rev 0x02 at pci0 dev 31 function 3 not configured isa0 at ichpcib0 isadma0 at isa0 pckbc0 at isa0 port 0x60/5 pckbd0 at pckbc0 (kbd slot) pckbc0: using irq 1 for kbd slot wskbd0 at pckbd0: console keyboard, using wsdisplay0 pmsi0 at pckbc0 (aux slot) pckbc0: using irq 12 for aux slot wsmouse0 at pmsi0 mux 0 pcppi0 at isa0 port 0x61 midi0 at pcppi0: <PC speaker> spkr0 at pcppi0 sysbeep0 at pcppi0 lpt0 at isa0 port 0x378/4 irq 7 lm0 at isa0 port 0x290/8: W83627HF npx0 at isa0 port 0xf0/16: using exception 16 pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo fdc0 at isa0 port 0x3f0/6 irq 6 drq 2 fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec biomask ef45 netmask ef65 ttymask ffe7 pctr: user-level cycle counter enabled umass0 at uhub0 port 2 configuration 1 interface 0 umass0: Prolific Technology Inc. Mass Storage Device, rev 2.00/1.00, addr 2 umass0: using SCSI over Bulk-Only scsibus3 at umass0: 2 targets sd2 at scsibus3 targ 1 lun 0: <WDC WD20, 00JB-00GVA0, 08.0> SCSI0 0/direct fixed sd2: 190782MB, 190782 cyl, 64 head, 32 sec, 512 bytes/sec, 390721969 sec total dkcsum: sd0 matched BIOS disk 80 dkcsum: sd1 had no matching BIOS disk dkcsum: sd2 matched BIOS disk 81 root on sd0a rootdev=0x400 rrootdev=0xd00 rawdev=0xd02 # $OpenBSD: sysctl.conf,v 1.35 2005/04/01 04:11:55 deraadt Exp $ # # This file contains a list of sysctl options the user wants set at # boot time. See sysctl(3) and sysctl(8) for more information on # the many available variables. # net.inet.ip.forwarding=1 # 1=Permit forwarding (routing) of packets #net.inet6.ip6.forwarding=1 # 1=Permit forwarding (routing) of packets #net.inet6.ip6.accept_rtadv=1 # 1=Permit IPv6 autoconf (forwarding must be 0) #net.inet.tcp.rfc1323=0 # 0=disable TCP RFC1323 extensions (for if tcp i s slow) #net.inet.tcp.rfc3390=1 # 1=Enable RFC3390 for TCP window increasing #net.inet.esp.enable=0 # 0=Disable the ESP IPsec protocol #net.inet.ah.enable=0 # 0=Disable the AH IPsec protocol #net.inet.esp.udpencap=0 # 0=Disable ESP-in-UDP encapsulation #net.inet.ipcomp.enable=1 # 1=Enable the IPCOMP protocol #net.inet.etherip.allow=1 # 1=Enable the Ethernet-over-IP protocol #net.inet.tcp.ecn=1 # 1=Enable the TCP ECN extension ddb.panic=0 # 0=Do not drop into ddb on a kernel panic #ddb.console=1 # 1=Permit entry of ddb from the console #fs.posix.setuid=0 # 0=Traditional BSD chown() semantics #vm.swapencrypt.enable=0 # 0=Do not encrypt pages that go to swap #vfs.nfs.iothreads=4 # number of nfsio kernel threads #net.inet.ip.mtudisc=0 # 0=disable tcp mtu discovery #kern.usercrypto=1 # 1=enable userland use of /dev/crypto #kern.splassert=2 # 2=enable and verbose error messages. #machdep.allowaperture=2 # See xf86(4) #machdep.apmwarn=10 # battery % when apm status messages enabled #machdep.apmhalt=1 # 1=powerdown hack, try if halt -p doesn't work #machdep.kbdreset=1 # permit console CTRL-ALT-DEL to do a nice halt #machdep.userldt=1 # allow userland programs to play with ldt, # required by some ports #kern.emul.aout=1 # enable running dynamic OpenBSD a.out bins #kern.emul.bsdos=1 # enable running BSD/OS binaries #kern.emul.freebsd=1 # enable running FreeBSD binaries #kern.emul.ibcs2=1 # enable running iBCS2 binaries #kern.emul.linux=1 # enable running Linux binaries #kern.emul.svr4=1 # enable running SVR4 binaries # For PostgreSQL Port #kern.seminfo.semmni=512 #kern.seminfo.semmns=4096 #kern.shminfo.shmall=65536 #kern.shminfo.shmmax=536870912 kern.seminfo.semmni=1024 kern.seminfo.semmns=8192 kern.shminfo.shmall=131072 kern.shminfo.shmmax=1073741824 kern.maxfiles=16384 kern.maxvnodes=16384