From owner-freebsd-net@FreeBSD.ORG Tue Jan 28 06:59:18 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A8F99E93; Tue, 28 Jan 2014 06:59:18 +0000 (UTC) Received: from mail-ie0-x22b.google.com (mail-ie0-x22b.google.com [IPv6:2607:f8b0:4001:c03::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA2D1E5B; Tue, 28 Jan 2014 06:59:18 +0000 (UTC) Received: by mail-ie0-f171.google.com with SMTP id as1so7191458iec.2 for ; Mon, 27 Jan 2014 22:59:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=/8sKFAiOTxgqgN0SxKq5sKBZZiVNiFDOP5opMVNTEO8=; b=rt+CP83wxfjJyiXH+yxoFI21VFG3DuZZ+HT6If4A0AsF3nzjwwtozwALJYNG4DaRoB ExpENXBcr1hnLisx2Mt+2P/xuuwYE3nH6oJNA9jNqKNPRYNDQVtowuxfPxPPJSMJwZ4e g55D71k9S/u7TS0ewUXKZm/dfCJ7uiNDqSlBkFjgcIEFG4wjc4amJCSxp6+q8h/MdY4z CF34PhZrtaHO6qSoBvJQe5rfFT7c8j0rKeYZDy7nT6pFEySNqo5dqbitykrL4lbrzZ1n hRW6p49um8YsoC4sRcJg0PlNxPnt8QeZwi5G/vxTnsE2Vjh6sGVBgLatdKJIXk62rPVL RFBw== MIME-Version: 1.0 X-Received: by 10.42.121.147 with SMTP id j19mr25148037icr.13.1390892357869; Mon, 27 Jan 2014 22:59:17 -0800 (PST) Sender: jdavidlists@gmail.com Received: by 10.42.170.8 with HTTP; Mon, 27 Jan 2014 22:59:17 -0800 (PST) In-Reply-To: References: <20140128002826.GU13704@funkthat.com> <1415339672.17282775.1390872779067.JavaMail.root@uoguelph.ca> <201401280427.s0S4RTVn077761@hergotha.csail.mit.edu> Date: Tue, 28 Jan 2014 01:59:17 -0500 X-Google-Sender-Auth: A8EVTsraayRwaKYEwWl0Vd1hdM4 Message-ID: Subject: Re: Terrible NFS performance under 9.2-RELEASE? From: J David To: wollman@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, Rick Macklem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 06:59:18 -0000 Another way to test this is to instrument the virtio driver, which turned out to be very straightforward: Index: if_vtnet.c =================================================================== --- if_vtnet.c (revision 260701) +++ if_vtnet.c (working copy) @@ -1886,6 +1887,7 @@ return (virtqueue_enqueue(vq, txhdr, &sg, sg.sg_nseg, 0)); fail: + sc->vtnet_stats.tx_excess_mbuf_drop++; m_freem(*m_head); *m_head = NULL; @@ -2645,6 +2647,9 @@ SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_task_rescheduled", CTLFLAG_RD, &stats->tx_task_rescheduled, "Times the transmit interrupt task rescheduled itself"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "tx_excess_mbuf_drop", + CTLFLAG_RD, &stats->tx_excess_mbuf_drop, + "Times packets were dropped due to excess mbufs"); } static int Index: if_vtnetvar.h =================================================================== --- if_vtnetvar.h (revision 260701) +++ if_vtnetvar.h (working copy) @@ -48,6 +48,7 @@ unsigned long tx_csum_bad_ethtype; unsigned long tx_tso_bad_ethtype; unsigned long tx_task_rescheduled; + unsigned long tx_excess_mbuf_drop; }; struct vtnet_softc { This patch didn't seem harmful from a performance standpoint since if things are working, the counter increment never gets hit. With this change, I re-ran some 64k tests. I found that the number of drops was very small, but not zero. On the client, doing the write-append test (which has no reads), it seems like it slowly builds up 8 with what appears to be some sort of back off (each one takes longer to appear than the last): $ sysctl dev.vtnet.1.tx_excess_mbuf_drop dev.vtnet.1.tx_excess_mbuf_drop: 8 But after 8, it appears congestion control is clamped down so hard that no more happen. Once read activity starts, the server builds up more: dev.vtnet.1.tx_excess_mbuf_drop: 53 So while there aren't a lot of these, they definitely do exist and there's just no way they're good for performance. Thanks!