From owner-freebsd-questions@FreeBSD.ORG Mon Sep 21 04:07:36 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BA3C106566C for ; Mon, 21 Sep 2009 04:07:36 +0000 (UTC) (envelope-from agus.262@gmail.com) Received: from mail-ew0-f208.google.com (mail-ew0-f208.google.com [209.85.219.208]) by mx1.freebsd.org (Postfix) with ESMTP id 103938FC13 for ; Mon, 21 Sep 2009 04:07:35 +0000 (UTC) Received: by ewy4 with SMTP id 4so2103496ewy.36 for ; Sun, 20 Sep 2009 21:07:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=I710/bjatfJQxU8wp+DLtW+jN9ADBrnT6qwCqgQqjHg=; b=WmPy9sNNviJ/3XCpPN+IutdZIMli0eSSHLZI1fNXca9qz+uZ8tdHtFOWK/DIgPEEJG PBDnxwLige1wglN6YiI79Ifz434QYF8IgXP5OL3ScPQtEreqp/FVDuIVvEwhX5sFzzMQ 8CTBeF0BmolRU87IaY9n+obLx+VhpSr2S/QJ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=uaK+atFqAxZOn6hU7bg6TTuVr3/8ZiB1JmOvt7Jcb7LCw0+pdVKgY7f4z7MCWbQRXj Qi4gkm07GKBG5Pxritv3lCyE1VeDDZbNen5jjh7AGYIuy5ENu5MTzx3k1Gnr3WXMeLej V7HN1FTnc2sSYSIDkn0bR/ECw8lqj7CvPxADY= MIME-Version: 1.0 Received: by 10.211.128.15 with SMTP id f15mr5001657ebn.84.1253506054053; Sun, 20 Sep 2009 21:07:34 -0700 (PDT) In-Reply-To: <200909201413.03882.pieter@degoeje.nl> References: <200909201413.03882.pieter@degoeje.nl> Date: Mon, 21 Sep 2009 01:07:34 -0300 Message-ID: From: Agus To: Pieter de Goeje Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org Subject: Re: Polling and kern.hz X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2009 04:07:36 -0000 2009/9/20 Pieter de Goeje : > On Saturday 19 September 2009, Agus wrote: >> Hi guys... >> >> Im reading ant playing with polling and kernel..... I read that >> polling increase net performance and i plan on using it... Now the >> question that arises is.. is polling and performance in general >> affected by the value of kern.hz? i have put in /boot.loader.con >> kern.hz=3D50 and was wondering if this number affects the number i >> choose for the polling options >> >> I wanna recompile kernel using >> >> options DEVICE_POLLING >> =A0options HZ=3D1000 >> >> So that 1000hz how affects the system? if it affects it at all........ >> >> thanks for anyone who can give me a hint.... >> >> Cheers, >> A > > To quote polling(4): > "Device polling disables interrupts by polling devices at appropriate > times, i.e., on clock interrupts and within the idle loop. =A0This way, t= he > context switch overhead is removed. =A0Furthermore, the operating system > can control accurately how much work to spend in handling device events, > and thus prevent livelock by reserving some amount of CPU to other tasks.= " > > HZ affects how often the device is polled. For high bandwidth situations,= it > is important that the latency is kept as low as possible. That means that= you > must poll the device as often as possible. So generally people use very h= igh > HZ values for polling, for example 10000. HZ=3D50 leads to latencies of a= bout > 20ms, way too high for normal network I/O. > > Note that you can change HZ without recompiling by specifying kern.hz=3D"= ###" in > loader.conf. > > -- > Pieter de Goeje > Thanks for the answer... I've been reading and find that i was confused... i thought that those hz where only for polling but i found that they are actually for the whole system clock... so now my doubt is if it will be better to activate polling and leave hz in 1000, or download hz to lets say 50 so i dont have too many context switches due to clock interrupts... I will try to test load changing only those parameters and come back with my results..... If u guys know any perf tester suitable for this please share..hehe... i will use iperf and will look for a web perf app..... Cheers, A