From owner-freebsd-current@FreeBSD.ORG Sun Jun 1 17:41:05 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 0339E468 for ; Sun, 1 Jun 2014 17:41:05 +0000 (UTC) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (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 85F5020A4 for ; Sun, 1 Jun 2014 17:41:04 +0000 (UTC) Received: by mail-wi0-f177.google.com with SMTP id f8so3381647wiw.16 for ; Sun, 01 Jun 2014 10:41:02 -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=/b+V4HQ+/Q/kG9DEmq0xEVWRSO1suKDXy6043IUX0aY=; b=x2e/npaKRta7RSCPKTxb0ECawaSDVRZkwFurtQZTasVZSEXSOXVgXpJw2HuS8H+96o KYoP2x2EPFxpHzXf0Wp/GLLzh4lzWtd2gEbkvYMfbgc46XjGdn8uLrYbSubwzsMx6Xgb xa0IMsjO/qiM+ZBD4qD8sJ3euVHJ2ZxWM48TOcnB6xdGe6c+mNZupEC58r3NCOAflYGY dM5DP3PiqoiLu5yOCt2R/ZWdaZQ+0uiDJ418rHaWghegCrIe7IxB7QzD5gZCOrguVDCh VAnE3deVRZyJpbzK/HmVMcCiHpEUzB5zGxedwAtwto/Vn8XaZfF6y2hmpZvXY6vTuThP jOog== MIME-Version: 1.0 X-Received: by 10.180.84.7 with SMTP id u7mr15535732wiy.31.1401644462815; Sun, 01 Jun 2014 10:41:02 -0700 (PDT) Sender: rizzo.unipi@gmail.com Received: by 10.194.246.130 with HTTP; Sun, 1 Jun 2014 10:41:02 -0700 (PDT) In-Reply-To: References: Date: Sun, 1 Jun 2014 19:41:02 +0200 X-Google-Sender-Auth: rbM_37OPpH4YYT-ZHpIGv700008 Message-ID: Subject: 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:41:05 -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. see why you are srving small batches. 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) -----------------------------------------+-------------------------------