From owner-freebsd-net@FreeBSD.ORG Thu Jan 31 09:43:37 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9565231B for ; Thu, 31 Jan 2013 09:43:37 +0000 (UTC) (envelope-from kevlo@kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 2AB6F7DD for ; Thu, 31 Jan 2013 09:43:36 +0000 (UTC) Received: from srg.kevlo.org (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id r0V9goVf084577; Thu, 31 Jan 2013 17:42:50 +0800 (CST) (envelope-from kevlo@kevlo.org) Message-ID: <510A3CA3.2010803@kevlo.org> Date: Thu, 31 Jan 2013 17:42:59 +0800 From: Kevin Lo User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Eggert, Lars" Subject: Re: high cpu usage on natd / dhcpd References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-net@freebsd.org" , "mjl@luckie.org.nz" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2013 09:43:37 -0000 On 2013/01/31 16:45, Eggert, Lars wrote: > Hi, > >> I have a small system running FreeBSD 8.2 that does NAT using ipfw and >> natd to systems attached to two interfaces: em0 and wlan0. I have a >> dhcpd daemon issuing leases on those interfaces. The system has an em1 >> interface plugged into a cable modem where it obtains a DHCP lease from >> an ISP. >> >> For some reason, when traffic from the Internet terminates on the system >> itself (I scp a file from the computer) the natd and dhcpd processes >> consume significant CPU, and the throughput is less than I expect. >> Traffic that passes through to a computer behind the NAT flows without >> causing the natd or dhcpd processes to measurably consume CPU. > I see exactly the same issue on -STABLE. Have you been able to figure out the cause? Use ipfw nat instead. It uses the libalias(3) in kernel and avoids gigantic natd(8) overhead. > > Thanks, > Lars > Kevin