From owner-freebsd-net@freebsd.org Fri Sep 11 17:19:16 2015 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3BE5A0255C for ; Fri, 11 Sep 2015 17:19:16 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [65.19.130.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.strugglingcoder.info", Issuer "mail.strugglingcoder.info" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C1F051352 for ; Fri, 11 Sep 2015 17:19:16 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 171A3C09DA; Fri, 11 Sep 2015 10:19:10 -0700 (PDT) Date: Fri, 11 Sep 2015 10:19:10 -0700 From: hiren panchasara To: Dmitry Sivachenko Cc: FreeBSD Net Subject: Re: netisr process eats 100% cpu Message-ID: <20150911171910.GN64965@strugglingcoder.info> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IpgPcFyQO6wM49Um" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2015 17:19:17 -0000 --IpgPcFyQO6wM49Um Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 09/11/15 at 12:46P, Dmitry Sivachenko wrote: >=20 > > hiren panchasara wrote: > >=20 > > Unsure at the moment if loopback is causing the trouble for you or not. > > See: >=20 > (please keep me CC'ed, I am not subscribed to -net) >=20 >=20 > > > > https://lists.freebsd.org/pipermail/freebsd-net/2015-February/041239.ht= ml > > > > >=20 > Yes, this thread looks similar. >=20 >=20 > > You may want to try: > > 1) pmcstat and see if you can catch something >=20 > What particular should I look for? Here is first lines of pmcstat -T -S = instructions -w 1: > PMC: [INSTR_RETIRED_ANY] Samples: 157198 (100.0%) , 0 unresolved >=20 > %SAMP IMAGE FUNCTION CALLERS > 13.2 kernel cpu_search_highest cpu_search_highest:12.0 sched_idlet= d:1.2 > 8.3 kernel ipfw_chk ipfw_check_packet > 3.1 myprogram memsetAVX _ZN12TLz4Compress7DoWriteEPKv > 2.3 kernel tcp_output tcp_usr_send:1.0 tcp_do_segment:0.9 >=20 >=20 > > 2) disable checksum on localhost >=20 >=20 > I tried, but nothing has changed. >=20 >=20 > > 3) look at netisr settings. sysctl net.isr o/p and how it looks under > > netstat -Q. I am not sure if adding more threads to netisr via >=20 >=20 > What should I look for? >=20 >=20 > > net.isr.numthreads would help. (Note its a loader.conf variable) >=20 >=20 > This netisr load looks parasitical to me (as I noted, moving haproxy to a= separate machine does not burn CPU cycles on netisr, why is localhost spec= ial?) >=20 > Even if adding more threads to netisr would boost network utilization, wo= uldn't those CPU cycles spent for netisr just be a waste of energy? I have= other tasks for these CPU. > I am not sure what keep cpu busy with netisr when localhost is involved. You may want to post o/p of=20 # sysctl net.isr # netstat -Q # sysctl net.inet | grep queue A suggestion I see at https://calomel.org/freebsd_network_tuning.html is to increase localhost n/w buffers. Not sure if this'll help your case. net.local.stream.sendspace=3D164240 # (default 8192) net.local.stream.recvspace=3D164240 # (default 8192) Now I'll let someone else with more ideas/clues comment. Cheers, Hiren --IpgPcFyQO6wM49Um Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJV8w0KXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/l0m8H/0xmKSS0SNp9uxn9I2k39uNG 7Mx+w2S4FlAvzOuVEhK8kteWSWTdaIhLIAYj45edU4tJNB0oBGmkvY7rRWqmwydf +2QaedAw1eph6N3NkcsVEgcx6muSXcSGYG5DgX7Tfrz2UKuf3qiXrJfSw6JHmqTO tTycvuAjNrEc4OLnm7R8OWsk+hwIHkwc/+K7AEUMCr+pnJ5DBt+yMIhIEDoLmqWV 8S+AMHe7zYJKHno45csqXwZuSNSSCcv3YhXmPFqcgtDzNIQt1Xo5Q1UPxF0XSGEa ypQG1H9m1QtaT6/lfefYWDk75zBK6dbM9yBx6QauN1ij6dAx21obJzm8kwgneVM= =3bgx -----END PGP SIGNATURE----- --IpgPcFyQO6wM49Um--