From owner-freebsd-net@freebsd.org Thu Apr 9 10:00:36 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7096D2B544A; Thu, 9 Apr 2020 10:00:36 +0000 (UTC) (envelope-from ozkan.kirik@gmail.com) Received: from mail-ua1-x92a.google.com (mail-ua1-x92a.google.com [IPv6:2607:f8b0:4864:20::92a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48yc8g3X10z4Pjv; Thu, 9 Apr 2020 10:00:35 +0000 (UTC) (envelope-from ozkan.kirik@gmail.com) Received: by mail-ua1-x92a.google.com with SMTP id a6so3741773uao.2; Thu, 09 Apr 2020 03:00:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PCNbLgVyXxAXTIz1/iOVQxWmSnoXMJB9VH6o4RqZxkU=; b=GAWFEClTm6N8qQNCRSo90CdPI10JuKRNffZJhClveOCXIjuTzSaCVtJLd0KRkYbPH/ LMcLoseCLqHtpugODuA8g9gLcQ82/S0hETbdtWmx2tBy4v8xTlGeZYEbRfeM/F6k48wL M1h1hL6mWXVu2kkahNizGwKJ3+6G+px7GtGyDci5XNVciCdSz5T5dJ1fQetFX1QI/aVr 3wwvvtqBjxi6tDTaytadYEoEZVSBH7Yeq8n4pGezFAZ+MN8pg4tdbqkunfUc151Kyu3e c5ldMguu60xYmZYkQzCheTmjGfcYZGW5kwaGv32NnjZ+ZjYBse0i+J5zQV9gZNzQDVmr Vlng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PCNbLgVyXxAXTIz1/iOVQxWmSnoXMJB9VH6o4RqZxkU=; b=G2MzHhCnN1G10Zj1SbzG+4cKKeZ/z69V6v8R7G+nESX3hUAU2TSyU/k46UR82k9tkB 41GDTlhFQOp8+D/0F8iMnaswYekdUKklGH8uQnZI64CW4JXfG5HUSpe2mNMtXEAmmHLz VOVX9h85cwI0QdbUVep/HFn4/S655HcMG4VI98T7zFIgJrVCZCNAJM0Az5kQ+YDeBrGI weeHKubmOr7awLkkAXT+a0M1GNQLQV9K6m5lmwo8sZ/rHt14EpHeWIbUDKsF3eMgd4v9 tsXmdw6/l1tuBhBeHjhIE3HFMhmgEgJNqQY3Dpov/xAJ09nquJPxub0XMCEKDbs5JsE8 pw0w== X-Gm-Message-State: AGi0PuY9lb/+N7tn+hcayZ4VZ4uuqoswbM82CckKB1E1gshHrAnXvZZf CBYAjH12BRAxITw9tq60QSHyy4NFgLi48U+iJwA= X-Google-Smtp-Source: APiQypLfFBo2rGiF8q5QCEMNY8tjGo89HrM+kP9iSItRigJiX9xbImMGvE/QdMDRBZXEqb/WPXf8ebDtRCwytZAuU6M= X-Received: by 2002:ab0:5550:: with SMTP id u16mr3626438uaa.62.1586426434505; Thu, 09 Apr 2020 03:00:34 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?w5Z6a2FuIEtJUklL?= Date: Thu, 9 Apr 2020 13:00:22 +0300 Message-ID: Subject: Re: dummynet performance To: Luigi Rizzo Cc: "freebsd-net@freebsd.org" , freebsd-ipfw , "Andrey V. Elsukov" X-Rspamd-Queue-Id: 48yc8g3X10z4Pjv X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=GAWFEClT; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ozkankirik@gmail.com designates 2607:f8b0:4864:20::92a as permitted sender) smtp.mailfrom=ozkankirik@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; IP_SCORE(0.00)[ip: (-9.73), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; IP_SCORE_FREEMAIL(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[a.2.9.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Apr 2020 10:00:36 -0000 In my production environment there are many schedulers and pipes & queues belongs to this scheds. dummynet uses %90-100 percent of single cpu. (ie. 20 scheds, 30 pipes, 35 queues total. Each pipe has max 30-100Mbps) In my idea, by distributing schedulers to different threads, all pipes that belongs to same scheduler also should run on same thread. By this way, dummynet can manage much higher total bandwidths. Thanks for greate explanation. In another way, for each scheduler we can create a new taskqueue_thread, Is it possible if dummnet_io() function will stay as is (in main thread), and it should call the right schedulers enqueue function that runs different thread? cheers Ozkan On Thu, Apr 9, 2020 at 12:43 PM Luigi Rizzo wrote: > On Thu, Apr 9, 2020 at 2:18 AM =C3=96zkan KIRIK w= rote: > > > > Hello, > > > > I wonder if it is possible to update dummynet code multi-threading > capable > > practically? > > My idea is below: > > - A new sysctl tunable will be defined as > > "net.inet.ip.dummynet.thread_count" (default 1) > > - To distribute tasks along threads, each sched instance can be assigne= d > to > > different thread. > > ... > > What are you trying to achieve ? In general, the scheduler needs to > know the state of all flows to perform correct scheduling of traffic. > You could in principle split the load on multiple threads under specific, > very restrictive conditions (each thread runs a different scheduler, they > cannot share the excess bandwidth, and the total bw does not exceed the > link's capacity, each scheduler has a different queue on the NIC). > > cheers > luigi >