From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 12:33:17 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BBDE916A41F; Fri, 28 Oct 2005 12:33:17 +0000 (GMT) (envelope-from mv@roq.com) Received: from p4.roq.com (ns1.ecoms.com [207.44.130.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66A7143D46; Fri, 28 Oct 2005 12:33:17 +0000 (GMT) (envelope-from mv@roq.com) Received: from p4.roq.com (localhost.roq.com [127.0.0.1]) by p4.roq.com (Postfix) with ESMTP id 1CDA84CECE; Fri, 28 Oct 2005 12:33:28 +0000 (GMT) Received: from [192.168.0.3] (ppp157-158.static.internode.on.net [150.101.157.158]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by p4.roq.com (Postfix) with ESMTP id 6DC684C40A; Fri, 28 Oct 2005 12:33:26 +0000 (GMT) Message-ID: <43621A8E.1060006@roq.com> Date: Fri, 28 Oct 2005 22:33:18 +1000 From: Michael VInce User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.7.12) Gecko/20051019 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Xu References: <30622.1130493370@critter.freebsd.dk> <4361FA1C.1070103@freebsd.org> <4361FDBE.7000500@freebsd.org> In-Reply-To: <4361FDBE.7000500@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP Cc: Pertti Kosunen , Poul-Henning Kamp , current@freebsd.org, "Yuriy N. Shkandybin" Subject: Re: Timers and timing, was: MySQL Performance 6.0rc1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 28 Oct 2005 12:33:17 -0000 David Xu wrote: > David Xu wrote: > >> Poul-Henning Kamp wrote: >> >>> In message <4361F057.4030904@pp.nic.fi>, Pertti Kosunen writes: >>> >>> >>>> Does polling affect to this test? >>> >>> >>> >>> >>> Not apart from the CPU overhead. >>> >>> sysctl kern.timecounter.hardware >>> >>> is much more important. >>> >>> and all the reports here which fail to include it are mostly >>> useless. >>> >>> >> I suspect because our time() function in libc uses gettimeofday, >> this further causes lots of gettimeofday syscall. >> >> > Now, I can confirm mysqld calls time() function lots of time, I have > changed time() to call clock_gettime, now there is few of gettimeofday > in ktrace result, but fully filled by clock_gettime. > Can we optimize time()? because it only returns second. > may we just create a syscall to return time_second variable in kernel, > this sounds crazy though. > Hey guys, I been watching this thread and I can confirm that MySQL and the Super-smack benchmark greatly rely on this, I was able to increase performance %600 by changing kern.timecounter.hardware to dummy. kessel# sysctl kern.timecounter.hardware=dummy kern.timecounter.hardware: ACPI-fast -> dummy kessel# super-smack /usr/share/smacks/select-key.smack 10 10000 Query Barrel Report for client smacker1 connect: max=0ms min=0ms avg= 0ms from 10 clients Query_type num_queries max_time min_time q_per_s select_index 200000 0 0 151328.05 kessel# sysctl kern.timecounter.hardware=TSC kern.timecounter.hardware: dummy -> TSC kessel# super-smack /usr/share/smacks/select-key.smack 10 10000 Query Barrel Report for client smacker1 connect: max=3ms min=2ms avg= 2ms from 10 clients Query_type num_queries max_time min_time q_per_s select_index 200000 0 0 25739.90 kessel# sysctl kern.timecounter.hardware=ACPI-fast kern.timecounter.hardware: TSC -> ACPI-fast kessel# super-smack /usr/share/smacks/select-key.smack 10 10000 Query Barrel Report for client smacker1 connect: max=3ms min=2ms avg= 2ms from 10 clients Query_type num_queries max_time min_time q_per_s select_index 200000 0 0 24070.67