From owner-freebsd-current@FreeBSD.ORG Thu Oct 27 07:12:25 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 C2E6116A420 for ; Thu, 27 Oct 2005 07:12:25 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DA98A43D6D; Thu, 27 Oct 2005 07:12:21 +0000 (GMT) (envelope-from davidxu@freebsd.org) Received: from [127.0.0.1] (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j9R7CJDv064173; Thu, 27 Oct 2005 07:12:20 GMT (envelope-from davidxu@freebsd.org) Message-ID: <43607DD5.3020708@freebsd.org> Date: Thu, 27 Oct 2005 15:12:21 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20050928 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Xin LI References: <435F48DA.6060009@kernel32.de> <1130320668.810.87.camel@spirit> In-Reply-To: <1130320668.810.87.camel@spirit> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: current@freebsd.org, Marian Hettwer Subject: Re: 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: Thu, 27 Oct 2005 07:12:25 -0000 Xin LI wrote: > Hi, Marian, > > 在 2005-10-26三的 11:14 +0200,Marian Hettwer写道: > >>Hi Folks, >> >>I'm using RC1 on some of my test servers and workstations. So far, it >>runs very good (as in stable and fast) :) >>However, I thought of doing a small benchmark of MySQL in comparison to >>Linux 2.6.8 (Debian Sarge) and the results are kinda... shocking. > > [...] > >>Any Ideas where this huge difference comes from? Did I oversee some >>debugging features still active in RC1 ? > > > There are many factors that can affect the performance of MySQL. Would > you please post the output of "dumpfs /var | head -n 21" on your server? > (Replace /var with whatever mountpoint that your database is stored in). > > Some observations that I think can affect MySQL performance: > - Our malloc(3) implementation might be sub-optimal for the workload. > - Lack of some POSIX system call which was implemented in other ways > (e.g. we do not have fsyncdata yet) > - Some detailed implementation difference between our and Linux's > threading library, or MySQL itself. > > I think David (davidxu@) had worked on performance of MySQL and he may > have some suggestions. > make sure key_buffer_size is 256M or more, set it in /etc/my.cnf: [mysqld] port = 3306 socket = /tmp/mysql.sock skip-locking key_buffer_size = 256M also, after key buffer size is no longer a bottleneck factor, try to repalce microtime() with getmicrotime() in gettimeofday syscall: the syscall is in /sys/kern/kern_time.c, here is some benchmark results: http://people.freebsd.org/~davidxu/mysql/gettimeofday_use_getmicrotime.txt http://people.freebsd.org/~davidxu/mysql/gettimeofday_use_microtime.txt Here is the ktrace dump for mysql server 4.1.14: http://people.freebsd.org/~davidxu/mysql/mysql_ktrace.txt Check gettimeofday syscall, it follows every I/O syscall, I think our gettimeofday is tooooooo expensive, if we can directly get time from memory, the performance will be improved further. > BTW. What file system are you using on your Debian test? What's the > mount options? > > Cheers,