From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1QrWhy-0004w6-3V for garchives@archives.gentoo.org; Thu, 11 Aug 2011 14:58:06 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9EE4621C1A3; Thu, 11 Aug 2011 14:57:41 +0000 (UTC) Received: from svr-us4.tirtonadi.com (unknown [69.65.43.212]) by pigeon.gentoo.org (Postfix) with ESMTP id 7F10E21C15E for ; Thu, 11 Aug 2011 14:56:18 +0000 (UTC) Received: from mail-fx0-f53.google.com ([209.85.161.53]) by svr-us4.tirtonadi.com with esmtpsa (TLSv1:RC4-SHA:128) (Exim 4.69) (envelope-from ) id 1QrWgD-000DzJ-Bi for gentoo-user@lists.gentoo.org; Thu, 11 Aug 2011 21:56:17 +0700 Received: by fxd23 with SMTP id 23so2217657fxd.40 for ; Thu, 11 Aug 2011 07:56:14 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Received: by 10.223.61.211 with SMTP id u19mr667361fah.146.1313074574547; Thu, 11 Aug 2011 07:56:14 -0700 (PDT) Received: by 10.223.100.4 with HTTP; Thu, 11 Aug 2011 07:56:14 -0700 (PDT) In-Reply-To: References: Date: Thu, 11 Aug 2011 21:56:14 +0700 Message-ID: Subject: Re: [gentoo-user] Re: Custom Timer Frequency (CONFIG_HZ)? From: Pandu Poluan To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - svr-us4.tirtonadi.com X-AntiAbuse: Original Domain - lists.gentoo.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - poluan.info X-Archives-Salt: X-Archives-Hash: bb8556ade3fc09a5709dee2d67749dcc On Thu, Aug 11, 2011 at 15:06, Nikos Chantziaras wrote: > On 08/11/2011 10:35 AM, Pandu Poluan wrote: >> >> On Thu, Aug 11, 2011 at 14:27, Nikos Chantziaras =C2=A0= wrote: >>> >>> On 08/11/2011 09:56 AM, Pandu Poluan wrote: >>>> >>>> Just wondering, is it possible to specify a custom timer frequency? >>>> E.g., HZ=3D500 instead of one of the canned values (100, 250, 300, >>>> 1000). >>> >>> It is possible, but it's a bad idea because non-standard values can >>> result >>> in driver breakage. =C2=A0Some code assumes specific timer granularitie= s >>> (100Hz =3D >>> 10ms, 250Hz =3D 4ms, etc). =C2=A0This usually happens with values above= 1000Hz, >>> so >>> it might be possible to experiment with non-standard sub-1000Hz values. >>> >>> But why do you want a custom value anyway? >>> >> >> Well, for a firewall, I've calculated (gathered and extrapolated from >> a lot of sources), the latency per-packet is usually less than 1 ms, >> at worst still less than 2 ms. >> >> Thus, setting the timer freq to 100 Hz (as suggested for 'normal' >> server load) means the timeslice is way too long (10 ms per time >> slice). >> >> So, I speculate that better -- and uniform -- performance will be >> achieved with a timer freq of 500 Hz. >> >> Of course, this is a wild speculation/guess from me. I never quite >> understand netfilter/xtables' relation to the timeslices, so I may be >> talking nonsense :-) > > This assumes that networking is dependent on the timer interrupt, which > doesn't seem to be the case; going from 100Hz to 1000Hz will not result i= n > network latencies dropping by 9ms. =C2=A0I know because I tried it on a s= erver. > That's what I was concerned of. > The only case where network latency improved with a higher HZ was with a > game server (Counter-Strike) and that's only because that game's server > component is timer dependent when calculating the game world (to do 1000 > updates per second it needs a HZ value of 1000). =C2=A0So that applicatio= n has > some real-time demands, meaning a high HZ value helps. =C2=A0Otherwise, y= ou can > stick to 100Hz on a server. =C2=A0Higher values won't change anything and= will > only reduce throughput (though not by much anyway, which is why some peop= le > set 1000Hz even on servers.) > Hmmm... I *do* feel better response (interaction-wise via SSH) if I use >100, so I think I'll settle for 250 Hz. Thanks for the explanation! Rgds, --=20 FdS Pandu E Poluan ~ IT Optimizer ~ =C2=A0=E2=80=A2 Blog : http://pepoluan.tumblr.com =C2=A0=E2=80=A2 Linked-In : http://id.linkedin.com/in/pepoluan