From owner-freebsd-current@FreeBSD.ORG Sun Jun 1 17:20:32 2014 Return-Path: Delivered-To: freebsd-current@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 4E34AF43 for ; Sun, 1 Jun 2014 17:20:32 +0000 (UTC) Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D11E02ECC for ; Sun, 1 Jun 2014 17:20:31 +0000 (UTC) Received: by mail-we0-f170.google.com with SMTP id u57so4171045wes.29 for ; Sun, 01 Jun 2014 10:20:30 -0700 (PDT) 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=EIZ+WdcxiT4NCAqnzvTJX1HNCxTH58h65ttQVR7ahz0=; b=s8Go1brKAGM9ybATZisfghR3GKkHFvn4CFOg+N02/EUPopjy0cDSJvjIF9QDWyiIeW UtC5HfLLub36On4DSFFf5c8h8fihDglYA8yLGeDeCz5x7KUy/eSNASdM60Czfz9MQK+g tPOhN4tRYocrotKIk8SfniU8dkRnDSMNtl/3PgCclll3zSvK+agw3a3iHykaFak0zpVM gCUFJ08K4iVg1iMwqxui5f/UwA2ErCY9tXV7aW2wctE09UX2MUbj7jsUinWi6ToeA89O VgDYJL60Kyi7FbmJt2TLqTkbmc6KIt/Kj5Ib1Uma2D3O84/oe96Zj1r3q8SvUJni4pSj jcsg== MIME-Version: 1.0 X-Received: by 10.180.183.131 with SMTP id em3mr15572886wic.56.1401643230169; Sun, 01 Jun 2014 10:20:30 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.194.246.130 with HTTP; Sun, 1 Jun 2014 10:20:30 -0700 (PDT) In-Reply-To: References: Date: Sun, 1 Jun 2014 19:20:30 +0200 X-Google-Sender-Auth: m0Pq7Ed8cL2ChklRpDZWFfEyYeQ Message-ID: Subject: Re: Select() vs Netmap From: Luigi Rizzo To: Fred Pedrisa Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18 Cc: freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2014 17:20:32 -0000 On Sunday, June 1, 2014, Fred Pedrisa wrote: > Hey, guys. > > > > > > I'm currently experiencing a strange issue in my program (Using netmap). > > > > Sometimes, when I call select() in a FD, it gets like 4~8 packets per > event, > however suddenly it drops to 1~2 packets per event, losing a lot of > performance and increasing the number of select calls necessary to poll the > NIC for new packets. > > > > Is there any type of tweak I can do, to make this behavior becomes linear > and sustain the performance in such case without these oscillations ? > > > > The behavior happens under the same stressing circumstances, around 1.4 > Mpps~ (64 byte packets). Is that one-point-four or fourteen? The firmer should be sustainable even with short batches. In any case apart from tweaking the interrupt moderation parameters in the device drivers, I'd check carefully the logic in your program and try to record a log of your activity. Average values rarely tell the full story of what is happening. One more thing, I think you use multuqueue, but no idea what kind of input traffic - whether it is all for the same destination or you have a mix of DST addresses. In the latter case, one thing to check is whether, on a restart of the program, the driver changes the hash key in the RSS filter. This might cause an imbalance in the traffic delivered to the queues. Cheers Luigi > > > > > Sincerely, > > > > Fred > > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org > " > -- -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------