From owner-freebsd-hackers Thu Jan 31 18:33:11 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id A1A3C37B400 for ; Thu, 31 Jan 2002 18:32:59 -0800 (PST) Received: from pool0359.cvx40-bradley.dialup.earthlink.net ([216.244.43.104] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16WTVV-0000SP-00; Thu, 31 Jan 2002 18:32:53 -0800 Message-ID: <3C59F75B.6F52F810@mindspring.com> Date: Thu, 31 Jan 2002 18:03:07 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Eugene Panchenko Cc: hackers@freebsd.org Subject: Re: Clock Granularity (kernel option HZ) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Eugene Panchenko wrote: > I've seen various postings on the Net where people reported > network-related and overall performance improvements caused > by settig HZ kernel option to 1000 (for example), that is, > reducing a tick size to 1ms for their FreeBSD and Linux > systems. This is a NETISR processing frequency hack. You can get the same effect by reducing the quantum clock, and not screwing around with HZ. > However, several problems seem to arise, such as > some device drivers do not include HZ in calculating their > timeout value, but simply assume HZ to be 100, and also some > utility programs such as top or ps take timing information > from the kernel in ticks, also assuming 10ms ticks, however, > most of these saying were related to Linux. How safe it is > to bump up HZ to, say, 1000 in FreeBSD (I use 4.5-STABLE)? > What pitfals will I encounter (drivers, top/ps)? FreeBSD already does this internally for profiling, so all the device drivers and everything are supposed to use the HZ value in their calculations. IF they don't, they are broken. There will be a minor issue of quick timeouts at the switch over point, in that the number of "ticks" that are expected is based on the frequency at the time the timer is instantiated, and the ticks per second going way up will cause them to fire much faster. This should be non-harmful, in most casess, since they should cause a retry (we would probably know by now from people like me who do extensive profiling that there was a problem, otherwise). > Is there are going to be [promised] performance increase? Probably not; it depends on how you measure performance. The time to establish a connection will go down, and the time to ACK will go down (the SYN cache obviates most of the wins, if that's the 4.5 snapshot you are using), and the time for a user space program will go down, if your system is I/O bound, and up if it's CPU bound. 8-). > Do I really need it? Are you running otu of memory? All you are doing is reducing the pool retention time. You should see an increase in the number of connections per second, etc., but it won't affect your throuput or your ability to move data, unless you end up getting some memory back that you were losing to pool retention before. > Thank you. Don't mention it. 8-). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message