From owner-freebsd-questions Mon Nov 6 8:55:45 2000 Delivered-To: freebsd-questions@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 1A30D37B4CF for ; Mon, 6 Nov 2000 08:55:42 -0800 (PST) Received: (from dan@localhost) by dan.emsphone.com (8.11.1/8.11.1) id eA6GtY104657; Mon, 6 Nov 2000 10:55:34 -0600 (CST) (envelope-from dan) Date: Mon, 6 Nov 2000 10:55:33 -0600 From: Dan Nelson To: Guy Gustavson Cc: questions@FreeBSD.ORG Subject: Re: ypserv using a LOT of cpu. Message-ID: <20001106105533.A12499@dan.emsphone.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.11i In-Reply-To: ; from "Guy Gustavson" on Mon Nov 6 10:28:54 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (Nov 06), Guy Gustavson said: > I recently moved my network of six machines over to NIS for passwd > authentication. > > I was amazed at how much cpu that ypserv is using on these boxes. In > fact that's why I added two NIS slave servers in the first place. > > last pid: 7252; load averages: 1.45, 1.29, 1.27 up 5+10:38:20 10:24:08 > 451 processes: 4 running, 446 sleeping, 1 zombie > CPU states: 16.7% user, 0.0% nice, 57.2% system, 5.0% interrupt, 21.1% idle > Mem: 780M Active, 112M Inact, 67M Wired, 30M Cache, 8345K Buf, 8428K Free > Swap: 256M Total, 916K Used, 255M Free > > PID USERNAME PRI NICE SIZE RES STATE C TIME WCPU CPU COMMAND > 453 root 95 0 1796K 1372K RUN 1 991:17 57.03% 57.03% ypserv This is definitely a lot more CPU that it should be using. I'd expect the CPU load to roughly match named, since they basically do the same thing. Two things you can do to help debug it: truss the process and see if it's doing a lot of unusual syscalls (lookups on nonexistant NIS maps, etc), and tcpdump your network traffic to see if the load is being caused by runaway lookups on one of your client machines. > (It would be using more on this machine, but it's a dual cpu box, and > it can only saturate the one cpu at a time) Aha. If it's buzz-looping in the code somwehere, try rebuilding ypserv with DEBUG_FLAGS=-g, start it up, wait for high CPU, generate a coredump with gcore, and load gdb up on the corefile to see what it's doing. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message