From owner-freebsd-net@freebsd.org Wed Nov 1 15:35:57 2017 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 7A408E5E573; Wed, 1 Nov 2017 15:35:57 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from onlyone.not-for.work (onlyone.not-for.work [IPv6:2a01:4f8:201:6350::2]) by mx1.freebsd.org (Postfix) with ESMTP id 41F467295D; Wed, 1 Nov 2017 15:35:57 +0000 (UTC) (envelope-from lev@FreeBSD.org) Received: from [192.168.19.110] (unknown [89.113.128.32]) (Authenticated sender: lev@serebryakov.spb.ru) by onlyone.not-for.work (Postfix) with ESMTPSA id 48BCBF64; Wed, 1 Nov 2017 18:35:49 +0300 (MSK) To: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Reply-To: lev@FreeBSD.org From: Lev Serebryakov Subject: Low default setting of UDBHASHSIZE leads to unresponsive system Organization: FreeBSD Message-ID: Date: Wed, 1 Nov 2017 18:35:43 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wit383s75hew81jjR4RBrW6HQK8cBIgFB" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Nov 2017 15:35:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wit383s75hew81jjR4RBrW6HQK8cBIgFB Content-Type: multipart/mixed; boundary="wjfLrliuG7HlGAqsBuXDWuLl3TCuIwtfX"; protected-headers="v1" From: Lev Serebryakov Reply-To: lev@FreeBSD.org To: freebsd-net@freebsd.org, freebsd-stable@freebsd.org Message-ID: Subject: Low default setting of UDBHASHSIZE leads to unresponsive system --wjfLrliuG7HlGAqsBuXDWuLl3TCuIwtfX Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Now 11-STABLE (and 12-CURRENT too) have this: sys/netinet/udp_usrreq.c:#define UDBHASHSIZE 128 Looks like such low value could lead to 100% consumption of CPU by interrupt threads (igb queues in my case) on heavy incoming UDP traffic (torrents with uTP in my case). My system (E3-1220v3 with I210 NICs) becomes completely unresponsive (nut complains about lost connection to UPS, ssh to system times out, etc) when system downloads torrent with many uTP (UDP) peers. Four igb0 queues consume 100% CPU each in this scenario. Total traffic could be very low like 500KiB/s (yes, 500KiB/s, not MiB/s!), I don't speak about 1Gbit/s or even 100Mbit/s here! Rebuilding kernel with UDBHASHSIZE=3D16384 seems to help. Why is this value so low and why I need to patch sources to change it? Many such settings are changeable via sysctl and/or tunables, but this one looks hardcoded. --=20 // Lev Serebryakov --wjfLrliuG7HlGAqsBuXDWuLl3TCuIwtfX-- --wit383s75hew81jjR4RBrW6HQK8cBIgFB Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEE+W0coLX0MYtnSzMK6rA8WL/cR48FAln56c9fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldEY5 NkQxQ0EwQjVGNDMxOEI2NzRCMzMwQUVBQjAzQzU4QkZEQzQ3OEYACgkQ6rA8WL/c R4/rQQ/8CsqPftmBflc7rJGdKg6vg+lKqPu4hG58x6I/8Iia6+r+m3XYSbOiyK6F LRNABz6AcEutv/6ctAchX9Gs+zvtP7qylowqxypJG+BoIXEIXFfrbn1B+yMJ2Tws 7M9EcpRxuHKIdzq5QHq3d/3w3h1muzL9z6V1k451UXfyJkGJXeYLtiuPqZGAJ90L 6lOi6NkE9Q8mc0OqhnIEfedXIVLN28OTlItSGHjKGKt2XSUGEvysy4WhLtXTIaF1 B66M5mPSqKhaexKiIiNKMzA5bw+Rh98HMo2u6+6nhh8JxVnmNPd0GDj/ziAuXNE2 zkiCqjOiU4h3yh6AqwJ0OC7pGMlIYy5Dm4TmSG055hV5SsO0045NucNJJXLOmuH6 /WHibM6xcLKqVmlQR2i9cMhlSwXQh4SlWNWe2gXsEc3XbF95ToACR4Jxrk3AKA8f 2m53K2Q3Sqsh26d4UCCNYQeVA0hwLOkRFihmZVH8u7L8/vXlxtB+n8CU4JfP0+Ri txyVgDo2hTD4JuNXGzB9d1Hvl9+Fi/Qbb6+fWardwdKewvNzXZuUcWzInvc/41vw LYqQPeTWO8G+2fPzP4uhZFizvsSyQm1jxwXBh3XtMJ0a7NrwJDhil0tKl5kpqVSU OvxxJHvBuMGfq6/bjJ3RUEXCmFzd+LMn+UrliZhAa4Eut+ybN7I= =jvBK -----END PGP SIGNATURE----- --wit383s75hew81jjR4RBrW6HQK8cBIgFB--