Subject: Too many open files
To: None <current-users@netbsd.org>
From: Martti Kuparinen <martti.kuparinen@iki.fi>
List: current-users
Date: 06/15/2007 10:13:03
Hi,

Suddenly one of our dom0 servers (running Xen 2) started to show these:

Jun 15 09:54:50 xen2 ntpd[29753]: ntpd 4.2.0-r Fri Jan 26 13:34:40 EET 2007 (1)
Jun 15 09:54:50 xen2 ntpd[29753]: precision = 1.000 usec
Jun 15 09:54:50 xen2 ntpd[29753]: kernel time sync status 0040
Jun 15 09:54:50 xen2 ntpd[29753]: Can't open /var/run/ntpd.pid: Too many open files
Jun 15 09:54:50 xen2 ntpd[29753]: open failed for /tmp/ntp29753a: Too many open 
files
Jun 15 09:54:50 xen2 ntpd[29753]: open failed for /tmp/ntp29753b: Too many open 
files
Jun 15 09:54:50 xen2 ntpd[29753]: open failed for /tmp/ntp29753c: Too many open

ktrace doesn't show anything interesting. At the same time I'm able to create a 
file like this:

# touch /tmp/foo
# ls -lh /tmp/foo
-rw-r--r--  1 root  wheel    0B Jun 15 09:58 /tmp/foo

# sysctl kern.maxfiles
kern.maxfiles = 5000

The ntpd is started like this with /etc/rc.d/ntpd:

# ps axww | grep ntp
29753 ?     Ss   0:00.03 /usr/sbin/ntpd -u ntpd:ntpd -i /var/chroot/ntpd

The server is running NetBSD 3.1.0_PATCH. On an identical server everything is 
rock solid (as it has always been).

Any ideas?

Martti