From owner-freebsd-performance@FreeBSD.ORG Thu Sep 15 02:03:26 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 996A6106566C for ; Thu, 15 Sep 2011 02:03:26 +0000 (UTC) (envelope-from jonschipp@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 32AA88FC12 for ; Thu, 15 Sep 2011 02:03:25 +0000 (UTC) Received: by fxg9 with SMTP id 9so249763fxg.13 for ; Wed, 14 Sep 2011 19:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=zSFdliVP5m9lD89pHWGR0R+Jw2EPxPrxf+gMobmycS4=; b=vRhP2ihBUlf76EtK4dhpHqhLVK2jfmwy+Znu5r02nbn9QENujTEw+RyRvMZKXzDelQ tTGCC8hEpzTNJ9f9J7Xsl09R1lASROw5ZfzbeOj9zE8vEUUstFzjAE0+0wKoPQ5GxUGp L90LSaB5RKppfbtr3gDjb7Xq5YAxxbY4bw4yo= MIME-Version: 1.0 Received: by 10.223.48.214 with SMTP id s22mr22884faf.104.1316050526932; Wed, 14 Sep 2011 18:35:26 -0700 (PDT) Received: by 10.152.2.162 with HTTP; Wed, 14 Sep 2011 18:35:26 -0700 (PDT) Date: Wed, 14 Sep 2011 21:35:26 -0400 Message-ID: From: Jon Schipp To: freebsd-performance@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Zero-Copy for packet capture and mbuf question X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2011 02:03:26 -0000 Has anyone used the zero-copy mechanism for an increased performance in packet capturing? I'm on FreeBSD 8.2-RELEASE, I was thinking about trying it. It's for a network monitoring system, it just grabs and dumps all data from all my network segments. I've noticed improvements by increasing the bpf buf size and maxbufsize which in turned increased the initial buffer size for libpcap. I'm dropping less now. In 8.2, is turning on zero-copy as simple as changing the value of net.bpf.zerocopy_enable? http://node5.blogspot.com/2009/11/very-quick-look-at-zero-copy-bpf-in.html I can't seem to find much information that shows that it's this simple. Right now it seems that if I want to use zero-copy for sends I would have to recompile the kernel with: options ZERO_COPY_SOCKETS But for receives, which is only what I'm concerned about, it seems that I just turn it on via sysctl. *I see that in 9.0 it will be on by default* Another question: I'm assuming all packets get copied to an mbuf from the NIC and then copied again to the bpf device/bpf buffer. Can anyone verify this? I don't think raising my mbufs will help, since a few hundred are free during peak hours. Will increasing the amount of mbuf clusters (nmbclusters) only help when you are pushing the threshold i.e. running out? Also, out of curiousity, is it possible to increase the amount of mbufs as opposed to the amount of mbuf clusters? Any help is appreciated. Thanks -- - Jon -- ------------------------------------------------------------------ VMB: 812-682-0231 Dubois County Linux User Group - http://www.dclinux.org Southern Indiana Computer Klub - http://sickbits.networklabs.org Bloomington FOOLS - http://www.bloomingtonfools.org/ BloomingLabs - http://www.bloominglabs.org ISSA-Kentuckiana - http://issa-kentuckiana.org GPG Key ID: 810903CB Key fingerprint = 0069 ED69 EABB DF84 5983 AD3C 6C20 BEFD 8109 03CB From owner-freebsd-performance@FreeBSD.ORG Thu Sep 15 05:10:47 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B012F106566B for ; Thu, 15 Sep 2011 05:10:47 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 6FAF28FC0A for ; Thu, 15 Sep 2011 05:10:47 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p8F4Wfim033993 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 14 Sep 2011 21:32:50 -0700 (PDT) (envelope-from julian@freebsd.org) Message-ID: <4E71800B.3080808@freebsd.org> Date: Wed, 14 Sep 2011 21:33:15 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14 MIME-Version: 1.0 To: Jon Schipp References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-performance@freebsd.org Subject: Re: Zero-Copy for packet capture and mbuf question X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2011 05:10:47 -0000 On 9/14/11 6:35 PM, Jon Schipp wrote: > Has anyone used the zero-copy mechanism for an increased performance in > packet capturing? > I'm on FreeBSD 8.2-RELEASE, I was thinking about trying it. It's for a > network monitoring system, it just grabs and dumps all data > from all my network segments. I've noticed improvements by increasing the > bpf buf size and maxbufsize which in turned increased the > initial buffer size for libpcap. I'm dropping less now. > > In 8.2, is turning on zero-copy as simple as changing the value of > net.bpf.zerocopy_enable? > http://node5.blogspot.com/2009/11/very-quick-look-at-zero-copy-bpf-in.html > I can't seem to find much information that shows that it's this simple. > Right now it seems that if I want to use zero-copy for sends > I would have to recompile the kernel with: options ZERO_COPY_SOCKETS > But for receives, which is only what I'm concerned about, it seems that I > just turn it on via sysctl. > > *I see that in 9.0 it will be on by default* > > Another question: I'm assuming all packets get copied to an mbuf from the > NIC and then copied again to the bpf device/bpf buffer. Can anyone verify > this? > I don't think raising my mbufs will help, since a few hundred are free > during peak hours. Will increasing the amount of mbuf clusters (nmbclusters) > only help when you are pushing the threshold i.e. running out? Also, out of > curiousity, is it possible to increase the amount of mbufs as opposed to the > amount of mbuf clusters? if you really want high performance packet capture and you are running one of the supported cards, see Luigi's work at: http://info.iet.unipi.it/~luigi/netmap/ > Any help is appreciated. > Thanks From owner-freebsd-performance@FreeBSD.ORG Thu Sep 15 20:31:51 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2999E106566B; Thu, 15 Sep 2011 20:31:51 +0000 (UTC) (envelope-from ohartman@zedat.fu-berlin.de) Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by mx1.freebsd.org (Postfix) with ESMTP id DBB618FC13; Thu, 15 Sep 2011 20:31:50 +0000 (UTC) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost1.zedat.fu-berlin.de (Exim 4.69) with esmtp (envelope-from ) id <1R4Ib7-0007TP-Ks>; Thu, 15 Sep 2011 22:31:49 +0200 Received: from e178034098.adsl.alicedsl.de ([85.178.34.98] helo=thor.walstatt.dyndns.org) by inpost2.zedat.fu-berlin.de (Exim 4.69) with esmtpsa (envelope-from ) id <1R4Ib7-00053h-IG>; Thu, 15 Sep 2011 22:31:49 +0200 Message-ID: <4E7260B5.5090401@zedat.fu-berlin.de> Date: Thu, 15 Sep 2011 22:31:49 +0200 From: "Hartmann, O." User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:6.0.2) Gecko/20110907 Thunderbird/6.0.2 MIME-Version: 1.0 To: "freebsd-performance@freebsd.org" , freebsd-current Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Originating-IP: 85.178.34.98 Cc: Subject: FreeBSD and GPGPU on nVidia (OpenCL/CUDA): Pathscale and "open" compute driver X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Sep 2011 20:31:51 -0000 Just read this on www.phoronix.com: http://www.phoronix.com/scan.php?page=news_item&px=OTkxMA Does it sound promising? It seems so. Even if this would be a commercial product which would fits into FreeBSD's gap of having GPU compute support, this could be an affordable solution. From owner-freebsd-performance@FreeBSD.ORG Sat Sep 17 16:38:23 2011 Return-Path: Delivered-To: freebsd-performance@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D5691065711 for ; Sat, 17 Sep 2011 16:38:23 +0000 (UTC) (envelope-from xaero@xaerolimit.net) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9DB8FC08 for ; Sat, 17 Sep 2011 16:38:22 +0000 (UTC) Received: by wwe3 with SMTP id 3so5922359wwe.31 for ; Sat, 17 Sep 2011 09:38:21 -0700 (PDT) Received: by 10.216.172.12 with SMTP id s12mr761524wel.10.1316276093178; Sat, 17 Sep 2011 09:14:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.93.67 with HTTP; Sat, 17 Sep 2011 09:14:32 -0700 (PDT) In-Reply-To: <20110907133646.29b11668@desktop.pc> References: <4E5941D6.9090106@zedat.fu-berlin.de> <20110907133646.29b11668@desktop.pc> From: Chris Brennan Date: Sat, 17 Sep 2011 12:14:32 -0400 Message-ID: To: Aldis Berjoza X-Mailman-Approved-At: Sat, 17 Sep 2011 16:56:45 +0000 Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-performance@freebsd.org" , freebsd-current@freebsd.org Subject: Re: http://www.freebsd.org/marketing/os-comparison.html X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Sep 2011 16:38:23 -0000 On Wed, Sep 7, 2011 at 6:36 AM, Aldis Berjoza wrote: This is interesting, and could be mentioned in updated page > http://www.phoronix.com/scan.php?page=article&item=linux_games_bsd&num=1 > > -- > Aldis Berjoza > http://www.bsdroot.lv/ > Anything gonna be done with this? It has promise but needs some more people involved. > -- > Chris Brennan > A: Yes. > >Q: Are you sure? > >>A: Because it reverses the logical flow of conversation. > >>>Q: Why is top posting frowned upon? > http://xkcd.com/84/ | http://xkcd.com/149/ | http://xkcd.com/549/ > GPG: D5B20C0C (6741 8EE4 6C7D 11FB 8DA8 9E4A EECD 9A84 D5B2 0C0C) ------------------------------------------------------------------------