From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) From: arisawa In-Reply-To: Date: Wed, 17 Feb 2016 10:13:49 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: References: <8FB7CBFD-7334-4F9F-8C71-571DEF9FAD31@ar.aichi-u.ac.jp> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] file descriptor leak Topicbox-Message-UUID: 854ce7aa-ead9-11e9-9d60-3106f5b1d025 the logic (code? usage?) of system(int fd, char *cmd) is ugly. thanks for fixing, cinap. charies may be speaking right point, because the dns server is running = only for my home use. only my family uses the dns service. my home network is very simple.I = have never used /net.alt for that. the dns had been running on file server and sometimes (once a month or = so) failed into trouble. a few weeks ago, I separated it from file server so that I can see the = trouble really comes from dns. the contents of /proc/N/fs are shown below. it seems /dev/null is not the criminal as charies suggested. how to find fd leakage? thanks in advance io% ps|grep dns arisawa 248 0:00 0:00 348K Await dns arisawa 249 0:00 0:00 14584K Pread dns arisawa 250 0:12 0:12 14576K Pread dns io% cat /proc/^(248 249 250)^/fd /usr/arisawa 0 r M 8 (0000000000000005 0 00) 8192 1 /dev/cons 1 w c 0 (0000000000000002 0 00) 0 1 #c/cons 2 w c 0 (0000000000000002 0 00) 0 193 #c/cons 3 r c 0 (000000000000000f 0 00) 0 4 /dev/random 4 w M 22 (000000000000ce7e 54050 40) 8192 1098023 /sys/log/dns 5 r c 0 (0000000000000001 0 00) 0 6873616 /dev/bintime 6 r M 22 (000000000000929e 3098 00) 8192 10949 /lib/ndb/local 7 r M 22 (000000000000929b 47 00) 8192 10242 /lib/ndb/common 8 r I 0 (0000000000000004 3 00) 0 127 /net/ndb 9 rw | 0 (0000000000000fc1 0 00) 65536 3954 #|/data 11 w s 0 (0000000000000009 0 00) 0 2 #s/dns /usr/arisawa 0 r M 8 (0000000000000005 0 00) 8192 1 /dev/cons 1 w c 0 (0000000000000002 0 00) 0 1 #c/cons 2 w c 0 (0000000000000002 0 00) 0 193 #c/cons 3 r c 0 (000000000000000f 0 00) 0 4 /dev/random 4 w M 22 (000000000000ce7e 54050 40) 8192 1098023 /sys/log/dns 5 r c 0 (0000000000000001 0 00) 0 6873816 /dev/bintime 6 r M 22 (000000000000929e 3098 00) 8192 10949 /lib/ndb/local 7 r M 22 (000000000000929b 47 00) 8192 10242 /lib/ndb/common 8 r I 0 (0000000000000004 3 00) 0 127 /net/ndb 9 rw | 0 (0000000000000fc1 0 00) 65536 3954 #|/data 11 w s 0 (0000000000000009 0 00) 0 2 #s/dns 12 rw I 0 (000000000002002d 0 00) 0 3362 /net/udp/1/data /usr/arisawa 0 r M 8 (0000000000000005 0 00) 8192 1 /dev/cons 1 w c 0 (0000000000000002 0 00) 0 1 #c/cons 2 w c 0 (0000000000000002 0 00) 0 193 #c/cons 3 r c 0 (000000000000000f 0 00) 0 4 /dev/random 4 w M 22 (000000000000ce7e 54050 40) 8192 1098023 /sys/log/dns 5 r c 0 (0000000000000001 0 00) 0 6873824 /dev/bintime 6 r M 22 (000000000000929e 3098 00) 8192 10949 /lib/ndb/local 7 r M 22 (000000000000929b 47 00) 8192 10242 /lib/ndb/common 8 r I 0 (0000000000000004 3 00) 0 127 /net/ndb 9 rw | 0 (0000000000000fc1 0 00) 65536 3954 #|/data 11 w s 0 (0000000000000009 0 00) 0 2 #s/dns 12 rw I 0 (000000000002002d 0 00) 0 3362 /net/udp/1/data io%=20 > 2016/02/17 7:24=E3=80=81Charles Forsyth = =E3=81=AE=E3=83=A1=E3=83=BC=E3=83=AB=EF=BC=9A >=20 >=20 > On 16 February 2016 at 15:52, arisawa = wrote: >=20 > I have observed warning messages from dns server: > dns 30792: warning process exceeded 100 file descriptors > dns 30888: warning process exceeded 200 file descriptors >=20 > It's worth noting that this message doesn't necessarily mean you've = got a file descriptor leak. > It might, but at the start it just means that a process (or process = group sharing a file descriptor group) has many file descriptors open. > That could happen if a server with many clients has a file descriptor = per client and then client requests open some more. >=20 > ndb/dns in particular will try user-level requests in parallel, and = those in turn can lead to several concurrent > queries to various name servers at a given level (root itself has 13). = Web browser clients will fetch page > elements concurrently. That's why it's useful to check the /proc/N/fd = file to try to see what they are. > (Not just for ndb/dns, but for other applications that provoke the = message.) > Arguably, if you're using the system in a real, Internet-facing = application, the warning message might > be obsolete, compared to the time when even 100 clients was a big = network.