Re: ipv4 connection problems

看板DFBSD_bugs作者時間21年前 (2005/03/15 15:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串10/22 (看更多)
--fjEAjMKpll6GDq3U Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 14, 2005 at 04:35:00PM -0800, Matthew Dillon wrote: > Peter. I did some webbench tests to try to reproduce the problem, and > I found two limitations that might have something to do with it. I= =20 > would like you to check these two things while your machine is not re= sponding > to apache requests. >=20 > If it turns out to be one of these two things, I don't think your iss= ue is > related to the firefox or opera issue. >=20 > You could be: >=20 > (1) Running out of sockets. > (2) Running out of tcp ports. >=20 >=20 > (1) Running out of sockets. Any server that accepts connections wil= l wind > up with the socket in a TIME_WAIT state for 2 minutes after the connecti= on > closes. >=20 > If your kern.ipc.maxsockets is, say, 5000, then 5000 / 120 seconds =3D=3D > only 33 connections per second before you run out of sockets. >=20 > (2) Running out of tcp ports. If you are getting a lot of connection= s from > the SAME IP address, the originating machine (the client you were using > to test connections to your ftp server in this case) may run out of TCP > ports or may start reusing ports that are still in TIME_WAIT on the=20 > target machine.=20 >=20 > 2 minutes to timeout it would only take 33 connections per second to run > out of ports. But ONLY if all the connections are coming from the same = IP > address (since the limitation is based on the {ipaddress,port} tuple, not > just the {port}). >=20 > How do you tell? When you hit this situation, do this: >=20 > sysctl net.inet.ip.portrange > sysctl kern.ipc.maxsockets > netstat -tn | wc -l > netstat -tn | fgrep TIME_WAIT | wc -l > netstat -m >=20 > And that should tell you (and us) what is going on. >=20 > If that turns out to be the case, then it probably is not related to = the > Opera/FireFox delay issue. >=20 Right after I had a hung telnet: box:~% sysctl net.inet.ip.portrange net.inet.ip.portrange.lowfirst: 1023 net.inet.ip.portrange.lowlast: 600 net.inet.ip.portrange.first: 1024 net.inet.ip.portrange.last: 5000 net.inet.ip.portrange.hifirst: 49152 net.inet.ip.portrange.hilast: 65535 box:~% sysctl kern.ipc.maxsockets kern.ipc.maxsockets: 12328 box:~% netstat -tn | wc -l 229 box:~% netstat -tn | fgrep TIME_WAIT | wc -l 25 box:~% netstat -m 1024/2278/26624 mbufs in use (current/peak/max): 1024 mbufs allocated to data 920/1306/6656 mbuf clusters in use (current/peak/max) 3181 Kbytes allocated to network (15% of mb_map in use) 0 requests for memory denied 0 requests for memory delayed 0 calls to protocol drain routines Peter --fjEAjMKpll6GDq3U Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (FreeBSD) iD8DBQFCNo6+Kjaxugguz8URAvTxAJ4+i8nzKJXgtYKNMo9ogHddaFvrgACgh2eW DN09JhdyCmD57prVy5TniIU= =X65w -----END PGP SIGNATURE----- --fjEAjMKpll6GDq3U--
文章代碼(AID): #12Dez-00 (DFBSD_bugs)
討論串 (同標題文章)
文章代碼(AID): #12Dez-00 (DFBSD_bugs)