Subject: RE: "Too many open files" hang in 1.3 and 1.3.3
To: 'port-i386@netbsd.org' <port-i386@netbsd.org>
From: Gunnar Helliesen <gunnar@bitcon.no>
List: port-i386
Date: 02/22/1999 06:11:19
I wrote:
> 
> I wrote:
> > 
> > Right now I have a server 500 Km away that I can't log into. 
> > It responds
> > to pings and it even responds to HTTP requests (it delivers 
> Web pages)
> > but trying to connect with FTP just times out and trying to 
> > connect with
> > telnet just leaves a blank screen (no banner and no 
> 'login:' prompt).
> 
> Following up on my own message:
> 
> Right now I can't even telnet to the machine any more, I just get
> "telnet: Unable to connect to remote host: Connection timed out". This
> is new, 20 minutes ago I got "Connected to <hostname>" and 
> then nothing.

Following up again:

The machine has been rebooted and I've had a look in /var/log/messages.
It was inetd printing out those messages, not the kernel.

It starts like this:


Feb 20 22:14:50 atlas inetd[226]: accept (for ftp): Too many open files
Feb 20 22:15:20 atlas last message repeated 104425 times
Feb 20 22:17:21 atlas last message repeated 412971 times
Feb 20 22:27:22 atlas last message repeated 1965086 times
Feb 20 22:37:22 atlas last message repeated 1992983 times
Feb 20 22:47:22 atlas last message repeated 1625536 times
Feb 20 22:57:22 atlas last message repeated 2073442 times

[snip...]

Feb 21 05:42:51 atlas last message repeated 2149572 times
Feb 21 05:52:51 atlas last message repeated 1887991 times
Feb 21 05:55:40 atlas last message repeated 552902 times
Feb 21 05:55:40 atlas inetd[226]: accept (for telnet): Too many open
files
Feb 21 05:55:40 atlas inetd[226]: accept (for ftp): Too many open files
Feb 21 05:55:40 atlas inetd[226]: accept (for telnet): Too many open
files
Feb 21 05:55:40 atlas inetd[226]: accept (for ftp): Too many open files
Feb 21 05:55:40 atlas inetd[226]: accept (for telnet): Too many open
files
Feb 21 05:55:40 atlas inetd[226]: accept (for ftp): Too many open files


... and then it continues like this until it quickly fills up /var.

There aren't as many FTP connections to the machine as those messages
would indicate, of course. It seems like inetd reaches a threshold of
some kind, and then enters a tight loop. One telnet request at 05:55 was
enough to make it print alternating "for ftp" and "for telnet" messages
until it filled up /var.

How do I fix this?

Gunnar

--
Gunnar Helliesen   | Bergen IT Consult AS  | NetBSD/VAX on a uVAX II
Systems Consultant | Bergen, Norway        | '86 Jaguar Sovereign 4.2
gunnar@bitcon.no   | http://www.bitcon.no/ | '73 Mercedes 280 (240D)