From owner-freebsd-transport@freebsd.org Tue Jun 18 20:59:12 2019 Return-Path: Delivered-To: freebsd-transport@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D5FF15C83DF for ; Tue, 18 Jun 2019 20:59:12 +0000 (UTC) (envelope-from freebsd@ruka.org) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFE348D8FB for ; Tue, 18 Jun 2019 20:59:09 +0000 (UTC) (envelope-from freebsd@ruka.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 6C57F2247D for ; Tue, 18 Jun 2019 16:59:03 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute1.internal (MEProxy); Tue, 18 Jun 2019 16:59:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ruka.org; h= mime-version:message-id:date:from:to:subject:content-type; s= mesmtp; bh=4NXG4ku6H3so7lVDlZzgkGAfu6PUXm0ooZ9uPiMq1pg=; b=ShQ0e eqkN6nx+xg0W5k9RCxbohI1Y0mFiQ6nSR5L402zG2RkzIlBa2P6PMI8zmQUd/EbN zYQxxFT9UURy9x7quarXdGXNo4/qWmClbnUECNoVtJ+uAPaxuOD4k1B/iu9MpqJG QjruDykVaYA4WcsKWKo3Xri1YR/JhYeL0JDiU4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=4NXG4ku6H3so7lVDlZzgkGAfu6PUX m0ooZ9uPiMq1pg=; b=yBi//I7lRqef0SDkBcY0rhVzUZW1PdbnUCZOEkfuIOCbK GfXn0KLa2/kudwSWi/IcYruxXtpG7f7e1aFpvY0ZZTY/UR8euqWsv8bofmI/SHGr 58GRURoJ+TycKTTY/hiH+M//eoU6J8Fuk9gZ87IqSII+rGC5vjI3mFUO1W/BDbR7 nRR7iVe2DhdS9/zsG/U1nFafNw3NHKfEs5nLu78K/T29rYlGxt39SY+qBlf4/PBC r14jm3r1GvrOMnajCkIY3eckTpGIaoahmgFpTEoB1D/3ngooLXCiaS5a8B2Vw73P Nz5Ule4vvc+AiMczZ8RC4iEPnapNHnq/6bKNF/Y4A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrtddtgdduvdejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfffhffvufgtsehmtderre erredtnecuhfhrohhmpedftfhitghhrghrugcutfhushhsohdfuceofhhrvggvsghsuges rhhukhgrrdhorhhgqeenucfrrghrrghmpehmrghilhhfrhhomhepfhhrvggvsghsugesrh hukhgrrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 18F77C200A3; Tue, 18 Jun 2019 16:59:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-666-gb2312fa-fmstable-20190614v4 Mime-Version: 1.0 Message-Id: <86d0c51a-959d-4656-9415-8de9e7f6ea10@www.fastmail.com> Date: Tue, 18 Jun 2019 13:59:02 -0700 From: "Richard Russo" To: freebsd-transport@freebsd.org Subject: RFC: patches to pcbhash and porthash Content-Type: multipart/mixed; boundary=da0c7ed35dc24091af7333be76bfb294 X-Rspamd-Queue-Id: DFE348D8FB X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ruka.org header.s=mesmtp header.b=ShQ0e eq; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=yBi//I7l; dmarc=pass (policy=none) header.from=ruka.org; spf=pass (mx1.freebsd.org: domain of freebsd@ruka.org designates 66.111.4.26 as permitted sender) smtp.mailfrom=freebsd@ruka.org X-Spamd-Result: default: False [-6.52 / 15.00]; XM_UA_NO_VERSION(0.01)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.26]; MV_CASE(0.50)[]; HAS_ATTACHMENT(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[ruka.org:+,messagingengine.com:+]; DMARC_POLICY_ALLOW(-0.50)[ruka.org,none]; MX_GOOD(-0.01)[in2-smtp.messagingengine.com,in1-smtp.messagingengine.com,in2-smtp.messagingengine.com,in1-smtp.messagingengine.com]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; FROM_EQ_ENVFROM(0.00)[]; IP_SCORE(-3.44)[ip: (-9.34), ipnet: 66.111.4.0/24(-4.74), asn: 11403(-3.08), country: US(-0.06)]; RCVD_TLS_LAST(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[26.4.111.66.list.dnswl.org : 127.0.5.1]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ruka.org:s=mesmtp,messagingengine.com:s=fm3]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/mixed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-transport@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+]; MID_RHS_WWW(0.50)[] X-BeenThere: freebsd-transport@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions of transport level network protocols in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jun 2019 20:59:12 -0000 --da0c7ed35dc24091af7333be76bfb294 Content-Type: text/plain I've developed the attached patches that helped reduce overhead on a tcp proxy machine with high usage (2M+ open sessions / 4M+ tcp connections, 20k + tcp open/second). Software stack is FreeBSD 12-RELEASE, with RSS enabled and HAProxy 2 with local patches for RSS support. Please let me know if these could be considered for inclusion, and what's the best way to proceed. The first patch fbsd12-siphash_for_pcb_hash.patch changes the pcbhash so that it's using siphash instead of bit operations, uses the local address in addition to the foreign address, and includes the full address for ipv6 addresses. Because of the high number of sessions, I've had to use multiple local addresses to connect to the backend servers; in the unpatched case, these all hash to the same value; additional, because of how my organization allocates IPv6, all of my IPv6 backend servers have the same lower 32-bits, so I ended up with very large lists in the hash tables, resulting in excessive CPU consumption during pcb lookups. The second patch fbsd12-move_comparison_to_portlist_head.patch changes the pcbporthash so that comparisons are done with the portheads, instead of potentially iterating on all pcbs that match the port. I also limited the size of the hashtable to a maximum 65536, since the hash is on port number and port number is limited to 65536. This helps reduce CPU spent checking for conflicts during binding of outgoing connections. I believe I correctly handled all of the cases, but there's a possibly wrong optimization for sockets with SO_REUSEADDR where I group all of these sockets as if they had their local address set to inaddr_any (or ipv6 version) -- this reduces the number of head entries to one per port number for outgoing connections in my case, instead of one per local address; this may not be correct or appropriate for all uses though. Thank you, Richard -- Richard Russo freebsd@ruka.org --da0c7ed35dc24091af7333be76bfb294 Content-Disposition: attachment;filename="fbsd12-siphash_for_pcb_hash.patch" Content-Type: application/octet-stream; name="fbsd12-siphash_for_pcb_hash.patch" Content-Transfer-Encoding: BASE64 SW5kZXg6IHN5cy9uZXRpbmV0L2luX3BjYi5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9uZXRp bmV0L2luX3BjYi5jCShyZXZpc2lvbiAzNDgwMDcpCisrKyBzeXMvbmV0aW5ldC9pbl9wY2I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wKKwkgICAgZmFkZHIsIGxwb3J0LCBmcG9ydCwgcGNiaW5mby0+aXBpX2hhc2htYXNr KV07CiAJQ0tfTElTVF9GT1JFQUNIKGlucCwgaGVhZCwgaW5wX2hhc2gpIHsKIAkJLyogWFhY IGlucCBsb2NraW5nICovCiAJCWlmICgoaW5wLT5pbnBfdmZsYWcgJiBJTlBfSVBWNikgPT0g MCkKQEAgLTExOTUsOSArMTE5Myw4IEBACiAJCSAqICAgICAgMy4gbm9uLWphaWxlZCwgbm9u LXdpbGQuCiAJCSAqICAgICAgNC4gbm9uLWphaWxlZCwgd2lsZC4KIAkJICovCi0JCWhlYWQg PSAmcGNiaW5mby0+aXBpX2hhc2hiYXNlW0lOUF9QQ0JIQVNIKAotCQkgICAgSU5QNl9QQ0JI QVNIS0VZKCZpbjZhZGRyX2FueSksIGxwb3J0LCAwLAotCQkgICAgcGNiaW5mby0+aXBpX2hh c2htYXNrKV07CisJCWhlYWQgPSAmcGNiaW5mby0+aXBpX2hhc2hiYXNlW2luNl9wY2JfaGFz aChwY2JpbmZvLT5pcGlfaGFzaGtleSwKKwkJICAgICZpbjZhZGRyX2FueSwgJmluNmFkZHJf YW55LCBscG9ydCwgMCwgcGNiaW5mby0+aXBpX2hhc2htYXNrKV07CiAJCUNLX0xJU1RfRk9S RUFDSChpbnAsIGhlYWQsIGlucF9oYXNoKSB7CiAJCQkvKiBYWFggaW5wIGxvY2tpbmcgKi8K IAkJCWlmICgoaW5wLT5pbnBfdmZsYWcgJiBJTlBfSVBWNikgPT0gMCkK --da0c7ed35dc24091af7333be76bfb294 Content-Disposition: attachment;filename="fbsd12-move_comparison_to_portlist_head.patch" Content-Type: application/octet-stream; name="fbsd12-move_comparison_to_portlist_head.patch" Content-Transfer-Encoding: BASE64 SW5kZXg6IHN5cy9uZXRpbmV0L2luX3BjYi5jCj09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5c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