From owner-freebsd-threads@FreeBSD.ORG Mon May 17 11:01:46 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C80516A4CE for ; Mon, 17 May 2004 11:01:46 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 097BF43D1F for ; Mon, 17 May 2004 11:01:46 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) i4HI1j28097699 for ; Mon, 17 May 2004 11:01:45 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i4HI1j1N097693 for freebsd-threads@freebsd.org; Mon, 17 May 2004 11:01:45 -0700 (PDT) (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 17 May 2004 11:01:45 -0700 (PDT) Message-Id: <200405171801.i4HI1j1N097693@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-threads@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 May 2004 18:01:46 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/06/13] kern/19247 threads uthread_sigaction.c does not do anything s [2004/03/15] kern/64313 threads FreeBSD (OpenBSD) pthread implicit set/un o [2004/04/22] threads/65883threads libkse's sigwait does not work after fork 3 problems total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/07/18] kern/20016 threads pthreads: Cannot set scheduling timer/Can o [2000/08/26] misc/20861 threads libc_r does not honor socket timeouts o [2001/01/19] bin/24472 threads libc_r does not honor SO_SNDTIMEO/SO_RCVT o [2001/01/25] bin/24632 threads libc_r delicate deviation from libc in ha o [2001/01/25] misc/24641 threads pthread_rwlock_rdlock can deadlock o [2001/11/26] bin/32295 threads pthread dont dequeue signals o [2002/02/01] i386/34536 threads accept() blocks other threads o [2002/05/25] kern/38549 threads the procces compiled whith pthread stoppe o [2002/06/27] bin/39922 threads [PATCH?] Threaded applications executed w o [2002/08/04] misc/41331 threads Pthread library open sets O_NONBLOCK flag o [2003/03/02] bin/48856 threads Setting SIGCHLD to SIG_IGN still leaves z o [2003/03/10] bin/49087 threads Signals lost in programs linked with libc a [2003/04/08] bin/50733 threads buildworld won't build, because of linkin o [2003/05/07] bin/51949 threads thread in accept cannot be cancelled 14 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/05/25] misc/18824 threads gethostbyname is not thread safe o [2000/10/21] misc/22190 threads A threaded read(2) from a socketpair(2) f o [2001/09/09] bin/30464 threads pthread mutex attributes -- pshared o [2002/05/02] bin/37676 threads libc_r: msgsnd(), msgrcv(), pread(), pwri s [2002/07/16] misc/40671 threads pthread_cancel doesn't remove thread from 5 problems total. From owner-freebsd-threads@FreeBSD.ORG Wed May 19 18:56:16 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDC7B16A4CE for ; Wed, 19 May 2004 18:56:16 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3401643D2D for ; Wed, 19 May 2004 18:56:16 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.250.26) by smtp01.syd.iprimus.net.au (7.0.024) id 409956B40048EDBD for threads@freebsd.org; Thu, 20 May 2004 11:56:05 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 8C6AB41CC; Thu, 20 May 2004 11:57:54 +1000 (EST) Date: Thu, 20 May 2004 11:57:54 +1000 From: Tim Robbins To: threads@freebsd.org Message-ID: <20040520015754.GA2572@cat.robbins.dropbear.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: execve() and KSE X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 01:56:17 -0000 What is supposed to happen when a threaded process (linked with libpthread) calls execve()? The program attached to this message seems to execute "true" correctly, but it never returns to the shell I invoked it from. ^T shows it in the state "running", and the system load average approaches 1.00: load: 0.15 cmd: true 726 [running] 0.00u 0.00s 0% 200k load: 0.56 cmd: true 726 [running] 0.00u 0.00s 0% 200k load: 0.91 cmd: true 726 [running] 0.00u 0.00s 0% 200k However, it's not using any CPU according to %CPU: $ ps -Haxo pid,%cpu,mwchan,state,command -p 726 PID %CPU MWCHAN STAT COMMAND 726 0.0 - RL+ true The system is FreeBSD 5.2-CURRENT/amd64 with a kernel from May 9, and with WITNESS and INVARIANTS both turned off. I'll try updating and re-enabling the diagnostic options later today. Here's the code in question: #include #include #include #include static pthread_cond_t cond; void * thrstart(void *a) { pthread_cond_wait(&cond, NULL); if (execl("/usr/bin/true", "true", NULL) < 0) perror("execl"); return (NULL); } int main(int argc, char *argv[]) { void *v; pthread_t t1; pthread_cond_init(&cond, NULL); pthread_create(&t1, NULL, thrstart, NULL); pthread_cond_broadcast(&cond); pthread_join(t1, &v); exit(0); } From owner-freebsd-threads@FreeBSD.ORG Wed May 19 21:15:38 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04CA316A4CE; Wed, 19 May 2004 21:15:38 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id C29D243D39; Wed, 19 May 2004 21:15:36 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <2004052004150001200kcabge>; Thu, 20 May 2004 04:15:01 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id VAA63356; Wed, 19 May 2004 21:14:59 -0700 (PDT) Date: Wed, 19 May 2004 21:14:58 -0700 (PDT) From: Julian Elischer To: Tim Robbins In-Reply-To: <20040520015754.GA2572@cat.robbins.dropbear.id.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: execve() and KSE X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 04:15:38 -0000 What is supposed to happen is that all the execve should stall awaiting all the other kernel threads to abort/suicide and then it should proceed with the execve as per normal. it is possible this doesn't work right.. I haven't tried ti for a LONG time.. julian On Thu, 20 May 2004, Tim Robbins wrote: > What is supposed to happen when a threaded process (linked with libpthread) > calls execve()? > > The program attached to this message seems to execute "true" correctly, but > it never returns to the shell I invoked it from. ^T shows it in the state > "running", and the system load average approaches 1.00: > > load: 0.15 cmd: true 726 [running] 0.00u 0.00s 0% 200k > load: 0.56 cmd: true 726 [running] 0.00u 0.00s 0% 200k > load: 0.91 cmd: true 726 [running] 0.00u 0.00s 0% 200k > > However, it's not using any CPU according to %CPU: > > $ ps -Haxo pid,%cpu,mwchan,state,command -p 726 > PID %CPU MWCHAN STAT COMMAND > 726 0.0 - RL+ true > > The system is FreeBSD 5.2-CURRENT/amd64 with a kernel from May 9, and with > WITNESS and INVARIANTS both turned off. I'll try updating and re-enabling > the diagnostic options later today. > > Here's the code in question: > > #include > #include > #include > #include > > static pthread_cond_t cond; > > void * > thrstart(void *a) > { > > pthread_cond_wait(&cond, NULL); > if (execl("/usr/bin/true", "true", NULL) < 0) > perror("execl"); > return (NULL); > } > > int > main(int argc, char *argv[]) > { > void *v; > pthread_t t1; > > pthread_cond_init(&cond, NULL); > pthread_create(&t1, NULL, thrstart, NULL); > pthread_cond_broadcast(&cond); > pthread_join(t1, &v); > > exit(0); > } > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Wed May 19 22:16:48 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB9C516A4CF; Wed, 19 May 2004 22:16:48 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C89343D54; Wed, 19 May 2004 22:16:48 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4K5GF8Q023667; Thu, 20 May 2004 01:16:15 -0400 (EDT) Date: Thu, 20 May 2004 01:16:15 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: Julian Elischer In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: threads@freebsd.org Subject: Re: execve() and KSE X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 05:16:49 -0000 On Wed, 19 May 2004, Julian Elischer wrote: > What is supposed to happen is that all the execve should stall awaiting > all the other kernel threads to abort/suicide and then it should proceed > with the execve as per normal. > it is possible this doesn't work right.. I haven't tried ti for a LONG > time.. The program is bogus also. First, you can't pass NULL to pthread_cond_wait() -- check the return values. Second, you can't join to a thread that has done an exec() -- the whole process has exec'd. I think you need to do this the old fashioned way (fork, exec, wait for child, etc). -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Wed May 19 23:10:10 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C2FA816A4CE for ; Wed, 19 May 2004 23:10:10 -0700 (PDT) Received: from smtp01.syd.iprimus.net.au (smtp01.syd.iprimus.net.au [210.50.30.52]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B31943D54 for ; Wed, 19 May 2004 23:10:10 -0700 (PDT) (envelope-from tim@robbins.dropbear.id.au) Received: from robbins.dropbear.id.au (210.50.217.190) by smtp01.syd.iprimus.net.au (7.0.024) id 409956B4004A461E; Thu, 20 May 2004 16:09:52 +1000 Received: by robbins.dropbear.id.au (Postfix, from userid 1000) id 4C8CB41CD; Thu, 20 May 2004 16:11:42 +1000 (EST) Date: Thu, 20 May 2004 16:11:42 +1000 From: Tim Robbins To: Daniel Eischen Message-ID: <20040520061142.GA3493@cat.robbins.dropbear.id.au> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i cc: threads@freebsd.org cc: Julian Elischer Subject: Re: execve() and KSE X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 06:10:10 -0000 On Thu, May 20, 2004 at 01:16:15AM -0400, Daniel Eischen wrote: > On Wed, 19 May 2004, Julian Elischer wrote: > > > What is supposed to happen is that all the execve should stall awaiting > > all the other kernel threads to abort/suicide and then it should proceed > > with the execve as per normal. > > it is possible this doesn't work right.. I haven't tried ti for a LONG > > time.. > > The program is bogus also. First, you can't pass NULL to > pthread_cond_wait() -- check the return values. Second, > you can't join to a thread that has done an exec() -- > the whole process has exec'd. I think you need to do > this the old fashioned way (fork, exec, wait for child, > etc). The call to pthread_cond_wait() with a NULL mutex argument was a mistake but the join was intentional. However, I'm not interested in the program; I'm more interested in the way the kernel handles the execve() call (and the general robustness of KSE heading up to 5.3-STABLE.) The following patch makes the program do what I would expect: exit, instead of getting stuck in the "running" state. It clears the P_SINGLE_EXIT and TDF_SA flags after clearing P_SA in kern_execve(). Without this, the flags are still set in the single-threaded process that comes out the other side of the execve() syscall, and it ends up getting stuck in sched_switch <- choosethread <- thread_exit <- thread_user_enter <- trap <- calltrap. (FWIW: there seems to be another nearby bug: the mtx_unlock(&Giant) call in the kern_execve() ERESTART case may be erroneous, since I can't see where Giant is acquired.) ==== //depot/user/tjr/freebsd-tjr/src/sys/kern/kern_exec.c#19 - /home/tim/p4/src/sys/kern/kern_exec.c ==== @@ -264,7 +264,8 @@ * If we get here all other threads are dead, * so unset the associated flags and lose KSE mode. */ - p->p_flag &= ~P_SA; + p->p_flag &= ~(P_SA|P_SINGLE_EXIT); + p->p_singlethread->td_flags &= ~TDF_SA; td->td_mailbox = NULL; thread_single_end(); } Tim From owner-freebsd-threads@FreeBSD.ORG Thu May 20 04:15:41 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0984B16A4CF; Thu, 20 May 2004 04:15:41 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DF06C43D49; Thu, 20 May 2004 04:15:40 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) i4KBFaRi085149; Thu, 20 May 2004 04:15:37 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <40AC92FF.804@freebsd.org> Date: Thu, 20 May 2004 19:14:07 +0800 From: David Xu User-Agent: Mozilla Thunderbird 0.5 (X11/20040503) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tim Robbins References: <20040520061142.GA3493@cat.robbins.dropbear.id.au> In-Reply-To: <20040520061142.GA3493@cat.robbins.dropbear.id.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: threads@freebsd.org cc: Julian Elischer Subject: Re: execve() and KSE X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 May 2004 11:15:41 -0000 Tim Robbins wrote: > On Thu, May 20, 2004 at 01:16:15AM -0400, Daniel Eischen wrote: > > >>On Wed, 19 May 2004, Julian Elischer wrote: >> >> >>>What is supposed to happen is that all the execve should stall awaiting >>>all the other kernel threads to abort/suicide and then it should proceed >>>with the execve as per normal. >>>it is possible this doesn't work right.. I haven't tried ti for a LONG >>>time.. >> >>The program is bogus also. First, you can't pass NULL to >>pthread_cond_wait() -- check the return values. Second, >>you can't join to a thread that has done an exec() -- >>the whole process has exec'd. I think you need to do >>this the old fashioned way (fork, exec, wait for child, >>etc). > > > The call to pthread_cond_wait() with a NULL mutex argument was a mistake > but the join was intentional. However, I'm not interested in the program; > I'm more interested in the way the kernel handles the execve() call > (and the general robustness of KSE heading up to 5.3-STABLE.) > > The following patch makes the program do what I would expect: exit, instead > of getting stuck in the "running" state. It clears the P_SINGLE_EXIT and > TDF_SA flags after clearing P_SA in kern_execve(). Without this, the flags > are still set in the single-threaded process that comes out the other > side of the execve() syscall, and it ends up getting stuck in > sched_switch <- choosethread <- thread_exit <- thread_user_enter <- > trap <- calltrap. > > (FWIW: there seems to be another nearby bug: the mtx_unlock(&Giant) call > in the kern_execve() ERESTART case may be erroneous, since I can't see > where Giant is acquired.) > > ==== //depot/user/tjr/freebsd-tjr/src/sys/kern/kern_exec.c#19 - /home/tim/p4/src/sys/kern/kern_exec.c ==== > @@ -264,7 +264,8 @@ > * If we get here all other threads are dead, > * so unset the associated flags and lose KSE mode. > */ > - p->p_flag &= ~P_SA; > + p->p_flag &= ~(P_SA|P_SINGLE_EXIT); > + p->p_singlethread->td_flags &= ~TDF_SA; > td->td_mailbox = NULL; > thread_single_end(); > } > > Good catch, I'd like to see P_SINGLE_EXIT is cleared in kern_thread.c::thread_single_end(). > Tim David Xu From owner-freebsd-threads@FreeBSD.ORG Fri May 21 15:55:44 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4FA5216A4CE for ; Fri, 21 May 2004 15:55:44 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1CA6E43D2D for ; Fri, 21 May 2004 15:55:42 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 69501 invoked by uid 89); 21 May 2004 22:59:59 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 21 May 2004 22:59:59 -0000 Message-Id: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Fri, 21 May 2004 15:55:42 -0700 To: freebsd-threads@freebsd.org From: JG Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 May 2004 22:55:44 -0000 We have a rather long discussion brewing over at the freebsd-amd64 mailing list: Subj: Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64? @ http://lists.freebsd.org/pipermail/freebsd-amd64/2004-May/thread.html Chris Elsworth also just posted a similar message on the MySQL general users list: http://lists.mysql.com/mysql/165908 He is on i386 architecture, so this problem seems to be universal for FreeBSD. I have been benchmarking many different configurations for several days now, and MySQL under Linux consistently SIGNIFICANTLY outperforms FreeBSD on the same hardware. Most of the time handling twice as many queries or more. After reading the posts at the mailing lists mentioned above, Do you have any suggestions or ideas as to what the problem is? Thanks - Jeremy From owner-freebsd-threads@FreeBSD.ORG Fri May 21 21:05:35 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1164D16A4CE for ; Fri, 21 May 2004 21:05:35 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB9CC43D3F for ; Fri, 21 May 2004 21:05:34 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4M45V8Q024017; Sat, 22 May 2004 00:05:31 -0400 (EDT) Date: Sat, 22 May 2004 00:05:31 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: JG In-Reply-To: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 04:05:35 -0000 On Fri, 21 May 2004, JG wrote: > > We have a rather long discussion brewing over at the freebsd-amd64 mailing > list: > > Subj: > Why > is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64? > > @ http://lists.freebsd.org/pipermail/freebsd-amd64/2004-May/thread.html > > > Chris Elsworth also just posted a similar message on the MySQL general > users list: > http://lists.mysql.com/mysql/165908 > > > > I have been benchmarking many different configurations for several days now, > and MySQL under Linux consistently SIGNIFICANTLY outperforms FreeBSD on the > same hardware. > Most of the time handling twice as many queries or more. We are more concerned about correctness right now than speed. There are some optimizations that can be made WRT low-level locking (for instance using cmpxchg when possible). The kernel also still has some more work WRT locking. Also, the default kernel configuration with WITNESS and INVARIANTS adds overhead. Yet another also, MySQL uses scope system threads by default instead of scope process threads. Scope process threads seem to perform better. http://people.freebsd.org/~deischen/mysql40-server.diffs You can also build mysql with LinuxThreads under FreeBSD and see if it performs any better. If it is comparable, that would tend to point to the kernel as the limiting factor. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Fri May 21 22:23:43 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35FDE16A4CE for ; Fri, 21 May 2004 22:23:43 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D57E43D45 for ; Fri, 21 May 2004 22:23:43 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 83821 invoked by uid 89); 22 May 2004 05:27:16 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 05:27:16 -0000 Message-Id: <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Fri, 21 May 2004 22:23:00 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: References: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 05:23:43 -0000 >After reading the posts at the mailing lists mentioned above, >Do you have any suggestions or ideas as to what the problem is? >We are more concerned about correctness right now than speed. >There are some optimizations that can be made WRT low-level >locking (for instance using cmpxchg when possible). The >kernel also still has some more work WRT locking. > >Also, the default kernel configuration with WITNESS and >INVARIANTS adds overhead. As stated in the benchmark results, WITNESS and INVARIANTS was disabled. Someone else brought that up very early on. >Yet another also, MySQL uses scope system threads by default >instead of scope process threads. Scope process threads seem >to perform better. > > http://people.freebsd.org/~deischen/mysql40-server.diffs Again, this patch was already made. It did next to nothing performance wise for MySQL. >You can also build mysql with LinuxThreads under FreeBSD >and see if it performs any better. LinuxThreads is not available for FreeBSD/AMD64. However, as reported on the freebsd-amd64 thread list archive, sadly, the best configuration turned out to be running this 64-bit AMD64 hardware in 32-bit mode under _i386_ FreeBSD rather than FreeBSD/AMD64 with mysql compiled with linuxthreads -- and those results were still very poor compared to a "out of the box" Linux + mysql install. > If it is comparable, >that would tend to point to the kernel as the limiting >factor. There is a significant improvement when using LinuxThreads vs libpthreads or libc_r, others have reported no difference with libthr as well. From owner-freebsd-threads@FreeBSD.ORG Sat May 22 00:00:10 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8592216A4CE for ; Sat, 22 May 2004 00:00:10 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65DB143D49 for ; Sat, 22 May 2004 00:00:09 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4M6xk3v019523; Sat, 22 May 2004 09:59:46 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AEFA5E.7060603@he.iki.fi> Date: Sat, 22 May 2004 09:59:42 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> In-Reply-To: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 07:00:10 -0000 JG wrote: > > > Do you have any suggestions or ideas as to what the problem is? I failed to find benchmark numbers using libpthread or libthr. Did you have some and I just missed them? Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 05:43:51 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5F75516A4CE for ; Sat, 22 May 2004 05:43:51 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15E4F43D45; Sat, 22 May 2004 05:43:51 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) i4MChJjW025240; Sat, 22 May 2004 05:43:21 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <40AF4A8D.4020602@freebsd.org> Date: Sat, 22 May 2004 20:41:49 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040522 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 12:43:51 -0000 I suggest you to do file system benchmark first, I suspect -CURRENT file system's performance is far behind than Linux. David Xu JG wrote: > > > >After reading the posts at the mailing lists mentioned above, > >Do you have any suggestions or ideas as to what the problem is? > > >> We are more concerned about correctness right now than speed. >> There are some optimizations that can be made WRT low-level >> locking (for instance using cmpxchg when possible). The >> kernel also still has some more work WRT locking. >> >> Also, the default kernel configuration with WITNESS and >> INVARIANTS adds overhead. > > > As stated in the benchmark results, WITNESS and INVARIANTS > was disabled. Someone else brought that up very early on. > > >> Yet another also, MySQL uses scope system threads by default >> instead of scope process threads. Scope process threads seem >> to perform better. >> >> http://people.freebsd.org/~deischen/mysql40-server.diffs > > > Again, this patch was already made. > It did next to nothing performance wise for MySQL. > > >> You can also build mysql with LinuxThreads under FreeBSD >> and see if it performs any better. > > > LinuxThreads is not available for FreeBSD/AMD64. > > However, as reported on the freebsd-amd64 thread list archive, > sadly, the best configuration turned out to be running this 64-bit AMD64 > hardware in 32-bit mode under _i386_ FreeBSD rather than FreeBSD/AMD64 > with mysql compiled with linuxthreads -- and those results were still > very poor > compared to a "out of the box" Linux + mysql install. > >> If it is comparable, >> that would tend to point to the kernel as the limiting >> factor. > > > There is a significant improvement when using LinuxThreads vs > libpthreads or libc_r, others have reported no difference with libthr > as well. > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to > "freebsd-threads-unsubscribe@freebsd.org" > > From owner-freebsd-threads@FreeBSD.ORG Sat May 22 05:45:40 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E90E216A4CE for ; Sat, 22 May 2004 05:45:40 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD85D43D39 for ; Sat, 22 May 2004 05:45:40 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 98888 invoked by uid 89); 22 May 2004 12:49:39 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 12:49:39 -0000 Message-Id: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 05:45:20 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: <40AEFA5E.7060603@he.iki.fi> References: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 12:45:41 -0000 At 09:59 AM 5/22/2004 +0300, you wrote: >JG wrote: > >> >> >>Do you have any suggestions or ideas as to what the problem is? > >I failed to find benchmark numbers using libpthread or libthr. Did you >have some and I just missed them? > >Pete Pete, 90% of the benchmarks I did were done with libptherads. I haven't personally tested with libthr, but others have and their results were poor as well. I wanted to avoid reposting pages of benchmarks, but I guess it's not going to happen. I'll start posting mine here here soon, I'm going to retest everything local with super-smack and run-all-tests today. You can also see Mikes run-all-tests benchmarks here: http://mikehost.com/~mike/tmp/bench.htm Here is a quote from an email Chris Elsworth sent me: "Just had a read through the web archive, all seems very familiar :) A colleague and I spent hours fiddling with the various threading libraries; kse, libc_r, libthr, linuxthreads I think were the main ones - I mostly tweaked MySQL, he tweaked the threading libraries, and nothing made any significant difference, so I'm not really convinced this is even a threading problem - I don't see why all the threading libraries we tried all struggle to outperform Linux's default configuration on the same hardware." Here is Chris Elsworths post to the MySQL general mailing list: http://lists.mysql.com/mysql/165908 Here is an article at 2cpu.com showing how Linux improved 20%: http://www.2cpu.com/articles/98_4.html ... But I wish I knew how he ran super-smack, those numbers are insane. And my original posts to the FreeBSD AMD64 list are here: http://lists.freebsd.org/pipermail/freebsd-amd64/2004-May/ Scroll down to: "Why is MySQL nearly twice as fast on Linux/AMD64 Vs. FreeBSD/AMD64? A lot of top posts so it got broken up a few times. ----------------------------------------------------------------------------------------------- From owner-freebsd-threads@FreeBSD.ORG Sat May 22 07:21:55 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAC2216A4CE for ; Sat, 22 May 2004 07:21:55 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 94D6D43D39 for ; Sat, 22 May 2004 07:21:55 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4MELh8Q024387; Sat, 22 May 2004 10:21:43 -0400 (EDT) Date: Sat, 22 May 2004 10:21:43 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: JG In-Reply-To: <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 14:21:56 -0000 On Fri, 21 May 2004, JG wrote: > >You can also build mysql with LinuxThreads under FreeBSD > >and see if it performs any better. > > LinuxThreads is not available for FreeBSD/AMD64. > > However, as reported on the freebsd-amd64 thread list archive, > sadly, the best configuration turned out to be running this 64-bit AMD64 > hardware in 32-bit mode under _i386_ FreeBSD rather than FreeBSD/AMD64 > with mysql compiled with linuxthreads -- and those results were still very poor > compared to a "out of the box" Linux + mysql install. > > > If it is comparable, > >that would tend to point to the kernel as the limiting > >factor. > > There is a significant improvement when using LinuxThreads vs > libpthreads or libc_r, others have reported no difference with libthr > as well. Can you point to the results (same hardware, native linux vs libpthread vs linuxthreads)? There is too much volume on amd64 to go searching. -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat May 22 07:38:40 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C5D216A4CE for ; Sat, 22 May 2004 07:38:40 -0700 (PDT) Received: from smtp.des.no (flood.des.no [217.116.83.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1E1243D1F for ; Sat, 22 May 2004 07:38:39 -0700 (PDT) (envelope-from des@des.no) Received: by smtp.des.no (Pony Express, from userid 666) id 7EFA55318; Sat, 22 May 2004 16:37:16 +0200 (CEST) Received: from dwp.des.no (des.no [80.203.228.37]) by smtp.des.no (Pony Express) with ESMTP id E760D530A; Sat, 22 May 2004 16:37:09 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 2602) id D1B2833CAA; Sat, 22 May 2004 16:37:09 +0200 (CEST) To: Daniel Eischen References: From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) Date: Sat, 22 May 2004 16:37:09 +0200 In-Reply-To: (Daniel Eischen's message of "Sat, 22 May 2004 00:05:31 -0400 (EDT)") Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on flood.des.no X-Spam-Level: X-Spam-Status: No, hits=0.0 required=5.0 tests=AWL autolearn=no version=2.63 cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 14:38:40 -0000 Daniel Eischen writes: > Yet another also, MySQL uses scope system threads by default > instead of scope process threads. Scope process threads seem > to perform better. Excuse me for digressing, but do you threads guys have some kind of occupational nerve damage which prevents you from using correct grammar? Why does everybody insist on talking about "scope system threads" and "scope process threads" instead of system-scope and process-scope threads? DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-threads@FreeBSD.ORG Sat May 22 07:41:15 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9BD8016A4CE for ; Sat, 22 May 2004 07:41:15 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8ED2143D2D for ; Sat, 22 May 2004 07:41:15 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 2978 invoked by uid 89); 22 May 2004 14:44:50 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 14:44:50 -0000 Message-Id: <5.2.0.9.2.20040522073501.015aa7c8@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 07:40:26 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: References: <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 14:41:15 -0000 > >Can you point to the results (same hardware, native linux vs >libpthread vs linuxthreads)? There is too much volume on >amd64 to go searching. I'm working on a bunch of LOCAL benchmarks right now. But I'll just repost here the benchmarks that have already been posted: More benchmarks... This time using super-smack. (All of these are on the same hardware using identical hotswap drives for OS's) -------------------------------------------------------------------- SERVER CONFIG: ** FreeBSD i386 ** amd32f# uname -a FreeBSD 5.2-RELEASE FreeBSD 5.2-RELEASE #0: Sun Jan 11 04:21:45 GMT 2004 Using Generic release Kernel MySQL: Ver 4.1.1-alpha for portbld-freebsd5.2 on i386 (FreeBSD port: mysql-server-4.1.1_2) MySQL Port options: BUILD_OPTIMIZED=yes MySQL compiled with linuxthreads: liblthread.so.3 => /usr/local/lib/liblthread.so.3 --------------------------------------------------------------------- Each benchmark ran several times and highest was shown. --------------------------------------------------------------------- Benchmark results: LOCAL: - Using default mysql config settings (empty/missing my.cnf) - Using SCHED_4BSD kernel amd32f# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=19ms min=12ms avg= 14ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 9 0 2589.28 update_index 300000 7 0 2589.28 - Using my-huge.cnf w/mysql.sock - Using SCHED_4BSD kernel amd32f# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=63ms min=13ms avg= 35ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 11 0 2369.88 update_index 300000 7 0 2369.88 REMOTE (Over 100mbit LAN dc0 to bge0): - Using default mysql config settings (empty/missing my.cnf) - Using SCHED_4BSD kernel devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=1431ms min=17ms avg= 731ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 10 0 2091.10 update_index 300000 4 0 2091.10 - Using my-huge.cnf w/mysql.sock lines in update-select.smack uncommented - Using SCHED_4BSD kernel devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=817ms min=37ms avg= 326ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 2 0 3718.13 update_index 300000 9 0 3718.13 *Note1: ps -H only shows 1 mysql line during test. *Note2: vmstat -w 1 ID's ~20 during this test. -------------------------------------------------------------------- SERVER CONFIG: ** FreeBSD AMD64 ** amd64f# uname -a FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Wed May 19 03:37:58 PDT 2004 Without -CURRENT debugging in kernel. MySQL: Ver 4.0.20 for portbld-freebsd5.2 on amd64 (FreeBSD port: mysql-server-4.0.20) With mysql-server40.diffs With libpthreads BUILD_OPTIMIZED=yes BUILD_STATIC=yes --------------------------------------------------------------------- Each benchmark ran several times and highest was shown. --------------------------------------------------------------------- Benchmark results: REMOTE (Over 100mbit LAN dc0 to bge0): - Using default mysql config settings (empty/missing my.cnf) w/mysql.sock unc# - Using SCHED_ULE devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=18ms min=1ms avg= 6ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 12 0 1672.22 update_index 300000 7 0 1672.22 *Note1: ps -H only shows 1 mysql line during test. *Note2: vmstat -w 1 ID's ~50 during this test. - Using default mysql config settings (empty/missing my.cnf) w/mysql.sock unc# - Using SCHED_4BSD devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=28ms min=2ms avg= 16ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 7 0 2685.53 update_index 300000 5 0 2685.53 *Note1: ps -H only shows 1 mysql line during test. *Note2: vmstat -w 1 ID's jump around between 20-50 during this test. - Using my-huge.cnf w/mysql.sock lines in update-select.smack uncommented - Using SCHED_ULE kernel devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=36ms min=1ms avg= 15ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 2 0 2813.09 update_index 300000 10 0 2813.09 *Note1: ps -H only shows 1 mysql line during test. *Note2: vmstat -w 1 ID's ~12 during this test. - Using my-huge.cnf w/mysql.sock lines in update-select.smack uncommented - Using SCHED_4BSD kernel devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=34ms min=1ms avg= 16ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 4 0 3229.12 update_index 300000 8 0 3229.12 *Note1: ps -H only shows 1 mysql line during test. *Note2: vmstat -w 1 ID's jump around between 20-50 during this test. As you can see, so far, the best results on the FreeBSD testing of this AMD64 hardware came from a 32-bit i386 install using MySQL compiled with Linuxthreads. ------------------------------------------------ Here is Linux: Compare the last set of benchmarks to these new ones. Using Linux Mandrake64 and super-smack: -------------------------------------------------------------------- SERVER CONFIG: ** Mandrake64 64-bit** SMP Mon Apr 19 10:48:13 CEST 2004 x86_64 unknown unknown GNU/Linux 2.6.3-9mdksmp MySQL: Ver 4.0.18 for mandrake-linux-gnu on x86_64 (Source distribution) [root at amd64m]# ldd /usr/sbin/mysqld librt.so.1 => /lib64/tls/librt.so.1 (0x0000002a9566d000) libdl.so.2 => /lib64/libdl.so.2 (0x0000002a95786000) libz.so.1 => /lib64/libz.so.1 (0x0000002a9588a000) libcrypt.so.1 => /lib64/libcrypt.so.1 (0x0000002a9599d000) libnsl.so.1 => /lib64/libnsl.so.1 (0x0000002a95ad0000) libpthread.so.0 => /lib64/tls/libpthread.so.0 (0x0000002a95be8000) <-- eh? libstdc++.so.5 => /usr/lib64/libstdc++.so.5 (0x0000002a95cfc000) libm.so.6 => /lib64/tls/libm.so.6 (0x0000002a95eda000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000002a96033000) libc.so.6 => /lib64/tls/libc.so.6 (0x0000002a9613e000) /lib64/ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2 (0x0000002a95556000) --------------------------------------------------------------------- Each benchmark ran 4 times and highest was shown. --------------------------------------------------------------------- REMOTE (Over 100mbit LAN dc0 to bge0): - Using "Stock" Mandrake64 Install, without my.cnf devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=65ms min=8ms avg= 20ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 4 0 4441.59 update_index 300000 1 0 4441.59 - Using "Stock" Mandrake64 Install, with my-huge.cnf but it compiled about max_connections @ 512 and dropped them to 457... 040521 1:17:42 Warning: setrlimit couldn't increase number of open files to more than 1024 (request: 1134) 040521 1:17:42 Warning: Changed limits: max_connections: 100 table_cache: 457 devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=65ms min=0ms avg= 21ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 5 0 4296.86 update_index 300000 15 0 4296.86 So the results above were the best so far. Strange that using the my-huge.cnf would produce worse results. I guess that's a question for the Mandrake list though. Anyway, the closest FreeBSD came so far was under 32-bit i386 (on AMD64 hardware) :-( - Using my-huge.cnf - Using SCHED_4BSD kernel - Using mysql compiled with linuxthreads - (see a couple posts back for complete details) devbox# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=817ms min=37ms avg= 326ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 2 0 3718.13 update_index 300000 9 0 3718.13 From owner-freebsd-threads@FreeBSD.ORG Sat May 22 09:32:51 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 816F316A4CE for ; Sat, 22 May 2004 09:32:51 -0700 (PDT) Received: from mail.mikehost.net (lvs-1.voxel.net [207.99.115.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 201F743D2D for ; Sat, 22 May 2004 09:32:49 -0700 (PDT) (envelope-from mike@mike2k.com) Received: by mail.mikehost.net (Postfix, from userid 502) id 2BF981BBE1; Sat, 22 May 2004 09:31:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.mikehost.net (Postfix) with ESMTP id 28EDB1BA74 for ; Sat, 22 May 2004 09:31:48 -0700 (PDT) Date: Sat, 22 May 2004 09:31:48 -0700 (PDT) From: mike X-X-Sender: mike@sql01.internal.mikehost.net To: freebsd-threads@freebsd.org In-Reply-To: Message-ID: References: mike: yes MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 16:32:51 -0000 On Sat, 22 May 2004, Daniel Eischen wrote: > On Fri, 21 May 2004, JG wrote: > > >You can also build mysql with LinuxThreads under FreeBSD > > >and see if it performs any better. > > > > LinuxThreads is not available for FreeBSD/AMD64. > > > > However, as reported on the freebsd-amd64 thread list archive, > > sadly, the best configuration turned out to be running this 64-bit AMD64 > > hardware in 32-bit mode under _i386_ FreeBSD rather than FreeBSD/AMD64 > > with mysql compiled with linuxthreads -- and those results were still very poor > > compared to a "out of the box" Linux + mysql install. > > > > > If it is comparable, > > >that would tend to point to the kernel as the limiting > > >factor. > > > > There is a significant improvement when using LinuxThreads vs > > libpthreads or libc_r, others have reported no difference with libthr > > as well. > > Can you point to the results (same hardware, native linux vs > libpthread vs linuxthreads)? There is too much volume on > amd64 to go searching. i will say that i on the same hardware, same configure options given to mysql (i install it from source, not ports) on both linux and mysql sported those results shown on my benchmark page. other people throughout the freebsd main list have also reported during the past few days that they've noticed mysql is not balancing the processes properly between CPUs. i'll repeat what i said there as well - this is an important issue to me and i will give anyone here access to my machine if they'd like, as well as give someone some cash to figure out and fix this bottleneck/issue. i did think at one point perhaps the file system could be partly to blame; but i think other (much more experienced folks) have already given their two cents on the other list reenforcing the fact that threading on freebsd5.x and mysql 4.x does not work properly. i don't really care where the holdup is, it's the combination of the two; people have reported it on SATA-based systems, SCSI-based systems, AMD64, AMD/i386 and Xeon-based i386 systems. there is a common theme - mysql+freebsd is bottlenecked somewhere. i am pledging whatever i have to to try to expedite the solution. - mike > > -- > Dan Eischen > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Sat May 22 09:37:18 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ED4EE16A4CE for ; Sat, 22 May 2004 09:37:18 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id A74EA43D4C for ; Sat, 22 May 2004 09:37:17 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4MGb33v021888; Sat, 22 May 2004 19:37:03 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AF81AA.4080101@he.iki.fi> Date: Sat, 22 May 2004 19:36:58 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040521215952.0166c368@mail.ojoink.com> <5.2.0.9.2.20040522073501.015aa7c8@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040522073501.015aa7c8@mail.ojoink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 16:37:19 -0000 What does ldd say for the -CURRENT pthread version? Is your world in sync with the kernel? Whatīs the value of kern.threads.virtual_cpu? Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 09:38:58 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D248B16A4CE for ; Sat, 22 May 2004 09:38:58 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id 20BC643D2F for ; Sat, 22 May 2004 09:38:58 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4MGcZ3v021893; Sat, 22 May 2004 19:38:35 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AF8207.8070801@he.iki.fi> Date: Sat, 22 May 2004 19:38:31 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 16:38:58 -0000 Dag-Erling Smørgrav wrote: > >Excuse me for digressing, but do you threads guys have some kind of >occupational nerve damage which prevents you from using correct >grammar? Why does everybody insist on talking about "scope system >threads" and "scope process threads" instead of system-scope and >process-scope threads? > > Itīs likely because thatīs what you type in; pthread_attr_setscope (&attributes,PTHREAD_SCOPE_SYSTEM); Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 09:47:04 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7E4A716A4CE for ; Sat, 22 May 2004 09:47:04 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id D9CEA43D1D for ; Sat, 22 May 2004 09:47:03 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4MGkX3v021928; Sat, 22 May 2004 19:46:33 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AF83E5.3090303@he.iki.fi> Date: Sat, 22 May 2004 19:46:29 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 16:47:04 -0000 JG wrote: > > > I haven't personally tested with libthr, but others have and their > results were poor as well. > > I wanted to avoid reposting pages of benchmarks, but I guess it's not > going to happen. > It would be interesting if mysql is cpu-bound or disk bound in your tests and if disk-bound, the relevant lines from dmesg would be appreciated. FreeBSD (if I remember correctly) does not do elevator on disks by default while most if not all linuxen do. That makes quite a difference on disk-bound loads. There are other things, like flush policy which behave differently by default, since linux mounts filesystems asynchronously by default. So if you want a fair comparison, all relevant parameters should be set to same, if they are not by default. Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 09:58:24 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16C0A16A4D3 for ; Sat, 22 May 2004 09:58:24 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id C5E5A43D1F for ; Sat, 22 May 2004 09:58:23 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 7375 invoked by uid 89); 22 May 2004 17:02:10 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 17:02:10 -0000 Message-Id: <5.2.0.9.2.20040522094946.01588470@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 09:57:50 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: <40AF83E5.3090303@he.iki.fi> References: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 16:58:24 -0000 >It would be interesting if mysql is cpu-bound or disk bound in your tests >and if disk-bound, the relevant lines from dmesg would be appreciated. >FreeBSD (if I remember correctly) does not do elevator on disks by default >while most if not all linuxen do. That makes quite a difference on >disk-bound loads. >There are other things, like flush policy which behave differently by >default, since linux mounts filesystems asynchronously by default. >So if you want a fair comparison, all relevant parameters should be set to >same, if they are not by default. > >Pete I don't think this explains why the threading is messed up. The best FreeBSD config I've got on my AMD64 64-bit hardware was running 32-bit i386 FreeBSD with MySQL compiled with Linuxthreads. And those results were poor compared to Linux tests - they were just much higher than any other FreeBSD config. I's been established on the other lists that threading is not being handled properly to begin with. That has been the longtime crux with MySQL on FreeBSD, and why "Linuxthreads" has been recommended for so long as well, no? Also, we see almost nearly the same results running on a single CPU as we do when we run SMP - I don't believe the HD is to blame here. From owner-freebsd-threads@FreeBSD.ORG Sat May 22 10:04:33 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CC1D416A4CE for ; Sat, 22 May 2004 10:04:33 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id A806A43D2D for ; Sat, 22 May 2004 10:04:33 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 7595 invoked by uid 89); 22 May 2004 17:08:46 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 17:08:46 -0000 Message-Id: <5.2.0.9.2.20040522100318.01598f50@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 10:04:24 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: <40AF83E5.3090303@he.iki.fi> References: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 17:04:33 -0000 >It would be interesting if mysql is cpu-bound or disk bound in your tests >and if disk-bound Anyway, I would be happy to do some disk I/O benchmarks as well. What program would you suggest for testing on both OS's ? - Jeremy From owner-freebsd-threads@FreeBSD.ORG Sat May 22 10:48:31 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB5BA16A4CE for ; Sat, 22 May 2004 10:48:31 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id D161243D2D for ; Sat, 22 May 2004 10:48:30 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4MHmE3v022172; Sat, 22 May 2004 20:48:14 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AF9259.9010204@he.iki.fi> Date: Sat, 22 May 2004 20:48:09 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040522100318.01598f50@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040522100318.01598f50@mail.ojoink.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 17:48:32 -0000 JG wrote: > >> It would be interesting if mysql is cpu-bound or disk bound in your >> tests and if disk-bound > > > > Anyway, I would be happy to do some disk I/O benchmarks as well. > > What program would you suggest for testing on both OS's ? > I was more suggesting toward running gstat when the mysql benchmark is running. Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 10:53:30 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B89C16A4CE for ; Sat, 22 May 2004 10:53:30 -0700 (PDT) Received: from rms04.rommon.net (rms04.rommon.net [212.54.2.140]) by mx1.FreeBSD.org (Postfix) with ESMTP id B241D43D1F for ; Sat, 22 May 2004 10:53:29 -0700 (PDT) (envelope-from pete@he.iki.fi) Received: from he.iki.fi (h91.vuokselantie10.fi [193.64.42.145]) by rms04.rommon.net (8.12.10/8.12.9) with ESMTP id i4MHrM3v022183; Sat, 22 May 2004 20:53:22 +0300 (EEST) (envelope-from pete@he.iki.fi) Message-ID: <40AF938D.5040400@he.iki.fi> Date: Sat, 22 May 2004 20:53:17 +0300 From: Petri Helenius User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 X-Accept-Language: en-us, en MIME-Version: 1.0 To: JG References: <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040522094946.01588470@mail.ojoink.com> In-Reply-To: <5.2.0.9.2.20040522094946.01588470@mail.ojoink.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 17:53:30 -0000 JG wrote: > > The best FreeBSD config I've got on my AMD64 64-bit hardware was > running 32-bit i386 FreeBSD with MySQL compiled with Linuxthreads. > And those results were poor compared to Linux tests - they were > just much higher than any other FreeBSD config. > Sure. I run mysql with linuxthreads because that was the only viable option a while ago. > > I's been established on the other lists that threading is not being > handled properly to begin with. > That has been the longtime crux with MySQL on FreeBSD, and why > "Linuxthreads" has been > recommended for so long as well, no? > > Also, we see almost nearly the same results running on a single CPU > as we do when we run SMP > > - I don't believe the HD is to blame here. > People with religion donīt do well on science. You have to pick if you are open to the truth or if you have made your mind up already. If you read my message again and follow itīs logic, youīll find it does not "blame the HD" but if you are disk-bound it does not help if you have one, two, four or a gazillion CPU's because they are not going to go any faster. Most linuxen sacrifice data integrity over performance by default. FreeBSD is the other way around. I donīt have an opinion of 32 vs 64 bit mode but with Opteron CPU's the performance in both environments is very close, you should not expect 64 bit mode to run double the speed of 32 bit mode. Pete From owner-freebsd-threads@FreeBSD.ORG Sat May 22 11:13:20 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41BCD16A4CE for ; Sat, 22 May 2004 11:13:20 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id DD2BD43D3F for ; Sat, 22 May 2004 11:13:19 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4MICW8Q018074; Sat, 22 May 2004 14:12:32 -0400 (EDT) Date: Sat, 22 May 2004 14:12:32 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: =?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?= In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 18:13:20 -0000 On Sat, 22 May 2004, [iso-8859-1] Dag-Erling Sm=F8rgrav wrote: > Daniel Eischen writes: > > Yet another also, MySQL uses scope system threads by default > > instead of scope process threads. Scope process threads seem > > to perform better. >=20 > Excuse me for digressing, but do you threads guys have some kind of > occupational nerve damage which prevents you from using correct > grammar? Why does everybody insist on talking about "scope system > threads" and "scope process threads" instead of system-scope and > process-scope threads? Sorry, probably because that's how POSIX defines them (PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS). --=20 Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat May 22 13:42:05 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D25DE16A4CE for ; Sat, 22 May 2004 13:42:05 -0700 (PDT) Received: from regina.plastikos.com (216-107-106-250.wan.networktel.net [216.107.106.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB6EC43D41 for ; Sat, 22 May 2004 13:42:05 -0700 (PDT) (envelope-from fullermd@over-yonder.net) Received: from mortis.over-yonder.net (adsl-19-159-58.jan.bellsouth.net [68.19.159.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by regina.plastikos.com (Postfix) with ESMTP id 9D9346EEB9; Sat, 22 May 2004 16:41:42 -0400 (EDT) Received: by mortis.over-yonder.net (Postfix, from userid 100) id BE76D20F2A; Sat, 22 May 2004 15:41:40 -0500 (CDT) Date: Sat, 22 May 2004 15:41:40 -0500 From: "Matthew D. Fuller" To: Dag-Erling Sm?rgrav Message-ID: <20040522204140.GV37882@over-yonder.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Editor: vi X-OS: FreeBSD User-Agent: Mutt/1.5.6i-fullermd.2 cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 20:42:05 -0000 On Sat, May 22, 2004 at 04:37:09PM +0200 I heard the voice of Dag-Erling Sm?rgrav, and lo! it spake thus: > > Excuse me for digressing, but do you threads guys have some kind of > occupational nerve damage which prevents you from using correct > grammar? I'll say that my experience in just writing threaded _CODE_ is enough to cause all kinds of nerve damage, either directly, or indirectly through increased alcohol consumption. I can only presume that writing a threads _IMPLEMENTATION_ would cause the same, in increased degree 8-} -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ "The only reason I'm burning my candle at both ends, is because I haven't figured out how to light the middle yet" From owner-freebsd-threads@FreeBSD.ORG Sat May 22 13:52:28 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A218916A4CE for ; Sat, 22 May 2004 13:52:28 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95F2E43D49 for ; Sat, 22 May 2004 13:52:28 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 15592 invoked by uid 89); 22 May 2004 20:56:35 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 20:56:35 -0000 Message-Id: <5.2.0.9.2.20040522135203.0165ea38@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 13:52:13 -0700 To: freebsd-threads@freebsd.org From: JG Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 20:52:28 -0000 At 08:53 PM 5/22/2004 +0300, you wrote: >JG wrote: > >> >>The best FreeBSD config I've got on my AMD64 64-bit hardware was >>running 32-bit i386 FreeBSD with MySQL compiled with Linuxthreads. >>And those results were poor compared to Linux tests - they were >>just much higher than any other FreeBSD config. >Sure. I run mysql with linuxthreads because that was the only viable=20 >option a while ago. Based on the results of myself and others who have posted on this same= subject, It also appears the be the best "viable option" _now_ as well. >>I's been established on the other lists that threading is not being=20 >>handled properly to begin with. >>That has been the longtime crux with MySQL on FreeBSD, and why=20 >>"Linuxthreads" has been >>recommended for so long as well, no? >> >>Also, we see almost nearly the same results running on a single CPU as=20 >>we do when we run SMP >> >> - I don't believe the HD is to blame here. >People with religion don=B4t do well on science. You have to pick if you= are=20 >open to the truth or if you have made your mind up already. People with delusions of infallibility don't do well with listening to=20 other people's suggestions or discoveries. >If you read my message again and follow it=B4s logic, you=B4ll find it does= =20 >not "blame the HD" but if you are disk-bound it does not help if you have= =20 >one, two, four or a gazillion CPU's because they are not going to go any=20 >faster. > I don=B4t have an opinion of 32 vs 64 bit mode but with Opteron CPU's the= =20 > performance in both environments is very close, you should not expect 64= =20 > bit mode to run double the speed of 32 bit mode. Who said anything about expecting double the performance when using a 64=20 bit machine? I don't expect all V8 engines to outperform all 4 cylinder=20 engines by twice as much either, go figure. From owner-freebsd-threads@FreeBSD.ORG Sat May 22 13:56:04 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7742A16A4CE for ; Sat, 22 May 2004 13:56:04 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 58CF043D2D for ; Sat, 22 May 2004 13:56:04 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 15734 invoked by uid 89); 22 May 2004 21:00:26 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 21:00:26 -0000 Message-Id: <5.2.0.9.2.20040522135338.0158cc50@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 13:56:05 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: <40AF9259.9010204@he.iki.fi> References: <5.2.0.9.2.20040522100318.01598f50@mail.ojoink.com> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040521154458.01627688@127.0.0.1> <5.2.0.9.2.20040522052606.0156fd70@mail.ojoink.com> <5.2.0.9.2.20040522100318.01598f50@mail.ojoink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 20:56:04 -0000 At 08:48 PM 5/22/2004 +0300, you wrote: >JG wrote: > >> >>>It would be interesting if mysql is cpu-bound or disk bound in your >>>tests and if disk-bound >> >> >> >>Anyway, I would be happy to do some disk I/O benchmarks as well. >> >>What program would you suggest for testing on both OS's ? >I was more suggesting toward running gstat when the mysql benchmark is >running. > >Pete While the benchmarks are running, gstat basically looks like this: amd64f# gstat dT: 0.502 flag_I 500000us sizeof 288 i -1 L(q) ops/s r/s kBps ms/r w/s kBps ms/w %busy Name 0 0 0 0 0.0 0 0 0.0 0.0| ad0 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1 0 0 0 0 0.0 0 0 0.0 0.0| acd0 0 0 0 0 0.0 0 0 0.0 0.0| amrd0 0 0 0 0 0.0 0 0 0.0 0.0| amrd1 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1a 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1b 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1c 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1d 0 0 0 0 0.0 0 0 0.0 0.0| ad0s1e 0 0 0 0 0.0 0 0 0.0 0.0| amrd0s1 0 0 0 0 0.0 0 0 0.0 0.0| amrd1s1 With the exception of a few split-second ticks to the amrd1 drive (the mysql data drive) From owner-freebsd-threads@FreeBSD.ORG Sat May 22 14:00:09 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D6AA116A4CE for ; Sat, 22 May 2004 14:00:09 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4922F43D2F for ; Sat, 22 May 2004 14:00:09 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4MKxA8Q026967; Sat, 22 May 2004 16:59:10 -0400 (EDT) Date: Sat, 22 May 2004 16:59:10 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: "Matthew D. Fuller" In-Reply-To: <20040522204140.GV37882@over-yonder.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 21:00:10 -0000 On Sat, 22 May 2004, Matthew D. Fuller wrote: > On Sat, May 22, 2004 at 04:37:09PM +0200 I heard the voice of > Dag-Erling Sm?rgrav, and lo! it spake thus: > > > > Excuse me for digressing, but do you threads guys have some kind of > > occupational nerve damage which prevents you from using correct > > grammar? > > I'll say that my experience in just writing threaded _CODE_ is enough > to cause all kinds of nerve damage, either directly, or indirectly > through increased alcohol consumption. I can only presume that > writing a threads _IMPLEMENTATION_ would cause the same, in increased > degree 8-} For you, err, what say ? :-) -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat May 22 15:38:59 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 38D8B16A4CF for ; Sat, 22 May 2004 15:38:59 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 12E5143D41 for ; Sat, 22 May 2004 15:38:59 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 19276 invoked by uid 89); 22 May 2004 22:43:04 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 22 May 2004 22:43:04 -0000 Message-Id: <5.2.0.9.2.20040522153551.01459300@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 15:38:42 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: <5.2.0.9.2.20040521154458.01627688@127.0.0.1> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 May 2004 22:38:59 -0000 > >Do you have any suggestions or ideas as to what the problem is? Here's some interesting benchmarks I just did... ----------------------------------------------------------------------- System Specs: Dual AMD Opteron 240's (1.4ghz) Tyan 2880UGNR server-class motherboard 2G PC-2700 reg ECC memory (2x 1gb modules) (3) Identical 40g ATA100 hot-swap system drives (for testing different OS's) LSI MegaRaid Zero channel RAID RAID-0 array consisting of 2x 15krpm 18gig SCSI U160 drives. (mysql data dir) ------------------------------------------------------------------------- OS / Software Configuration: FreeBSD 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Fri May 21 05:09:21 PDT 2004 MySQL Compiled from mysql40-server port with: BUILD_OPTIMIZED=yes CONFIGURE_ARGS= --localstatedir=${DB_DIR} \ --without-debug \ --without-readline \ --with-bench \ --without-extra-tools \ --without-libwrap \ --with-mysqlfs \ --with-vio \ --with-low-memory \ --with-comment='FreeBSD port: ${PKGNAME}' \ --enable-thread-safe-client amd64f# ldd /usr/local/libexec/mysqld /usr/local/libexec/mysqld: libpthread.so.1 => /usr/lib/libpthread.so.1 (0x2008ac000) libz.so.2 => /lib/libz.so.2 (0x2009d6000) libcrypt.so.2 => /lib/libcrypt.so.2 (0x200ae5000) libstdc++.so.4 => /usr/lib/libstdc++.so.4 (0x200bff000) libm.so.2 => /lib/libm.so.2 (0x200de6000) libc.so.5 => /lib/libc.so.5 (0x200f06000) (Compiled with libpthread) Also w/ http://people.freebsd.org/~deischen/mysql40-server.diffs patch. ------------------------------------------------------------------------- BENCHMARK RESULTS: Local test: - Using AMD64-4BSD SMP kernel w/SCHED_4BSD - Using default mysql config (no config file) amd64f# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=25ms min=4ms avg= 15ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 11 0 2819.41 update_index 300000 7 0 2819.41 - Using AMD64-4BSD-NOSMP SINGLE CPU kernel w/SCHED_4BSD - Using default mysql config (no config file) amd64f# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=21ms min=9ms avg= 16ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 5 0 3015.96 update_index 300000 23 5 3015.96 The ONLY thing different between the two tests was a kernel with a commented SMP line. - and the single CPU kernel outperformed the dual CPU kernel. From owner-freebsd-threads@FreeBSD.ORG Sat May 22 21:03:47 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0182216A4CE for ; Sat, 22 May 2004 21:03:47 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89C4343D3F for ; Sat, 22 May 2004 21:03:46 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.10/8.12.1) with ESMTP id i4N43N8Q007886; Sun, 23 May 2004 00:03:27 -0400 (EDT) Date: Sun, 23 May 2004 00:03:23 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: JG In-Reply-To: <5.2.0.9.2.20040522153551.01459300@mail.ojoink.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 04:03:47 -0000 On Sat, 22 May 2004, JG wrote: > > > > >Do you have any suggestions or ideas as to what the problem is? [...] > (Compiled with libpthread) > > Also w/ http://people.freebsd.org/~deischen/mysql40-server.diffs patch. > ------------------------------------------------------------------------- > > BENCHMARK RESULTS: > > Local test: > > - Using AMD64-4BSD SMP kernel w/SCHED_4BSD > - Using default mysql config (no config file) > > amd64f# super-smack update-select.smack 30 10000 > Query Barrel Report for client smacker > connect: max=25ms min=4ms avg= 15ms from 30 clients > Query_type num_queries max_time min_time q_per_s > select_index 300000 11 0 2819.41 > update_index 300000 7 0 2819.41 > > > - Using AMD64-4BSD-NOSMP SINGLE CPU kernel w/SCHED_4BSD > - Using default mysql config (no config file) > > amd64f# super-smack update-select.smack 30 10000 > Query Barrel Report for client smacker > connect: max=21ms min=9ms avg= 16ms from 30 clients > Query_type num_queries max_time min_time q_per_s > select_index 300000 5 0 3015.96 > update_index 300000 23 5 3015.96 Along with the other benchmarks it's still a little apples and oranges. I've seen different versions of mysql run with different versions of FreeBSD. I'd like to see the same mysql version run on the same hardware with libpthread and linuxthreads. What I've seen so far is close WRT OS and mysql versions, but still not the same: mysql-4.1.1-alpha on FreeBSD 5.2-RELEASE with linuxthreads, SCHED4_BSD, amd32 ---------------------------------------------------------- Local: - Using default mysql config settings (empty/missing my.cnf) - Using SCHED_4BSD kernel amd32f# super-smack update-select.smack 30 10000 Query Barrel Report for client smacker connect: max=19ms min=12ms avg= 14ms from 30 clients Query_type num_queries max_time min_time q_per_s select_index 300000 9 0 2589.28 update_index 300000 7 0 2589.28 mysql-4.0.20 (with process-scope patch) on FreeBSD 5.2-current with libpthread, SCHED4_BSD, amd64 -------------------------------------------------------------- 2819.41 (SMP), 3015.96 (UP), see quoted email above This shows that -current (both SMP and UP) with libpthread is faster than linuxthreads (different versions of FreeBSD and mysql, though). Also, if you use the default mysql config settings, then FreeBSD remote vs Linuxthreads remote also wins (2685.53 vs. 2091.10 from earlier post). What modifications are you making to /etc/my.cnf and why do they turn the results around the other way? -- Dan Eischen From owner-freebsd-threads@FreeBSD.ORG Sat May 22 21:33:21 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 86ED516A4CE for ; Sat, 22 May 2004 21:33:21 -0700 (PDT) Received: from ojoink.com (center.ojoink.com [216.65.123.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 42A5443D2F for ; Sat, 22 May 2004 21:33:19 -0700 (PDT) (envelope-from amd64list@jpgsworld.com) Received: (qmail 30349 invoked by uid 89); 23 May 2004 04:37:46 -0000 Received: from unknown (HELO MAINBX.jpgsworld.com) (amd64list@jpgsworld.com@24.10.96.33) by center.ojoink.com with SMTP; 23 May 2004 04:37:46 -0000 Message-Id: <5.2.0.9.2.20040522212217.01511190@mail.ojoink.com> X-Sender: amd64list@jpgsworld.com@mail.ojoink.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.0.9 Date: Sat, 22 May 2004 21:33:22 -0700 To: freebsd-threads@freebsd.org From: JG In-Reply-To: References: <5.2.0.9.2.20040522153551.01459300@mail.ojoink.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 04:33:21 -0000 >Along with the other benchmarks it's still a little apples >and oranges. I've seen different versions of mysql run >with different versions of FreeBSD. I'm going to stick with 4.0.20 from now for tests. Most of my tests were done on 4.0.20. > I'd like to see the >same mysql version run on the same hardware with libpthread >and linuxthreads. I'll have to do that on the i386 install tomorrow, as Linuxthreads is not available for FreeBSD/AMD64. >This shows that -current (both SMP and UP) with libpthread is >faster than linuxthreads (different versions of FreeBSD and >mysql, though). For FreeBSD nothing (remote) has been faster than the i386 Linuxthreads test. I'll do everything local tomorrow. >Also, if you use the default mysql config settings, then >FreeBSD remote vs Linuxthreads remote also wins (2685.53 >vs. 2091.10 from earlier post). I understand what you're saying, but those numbers are horrible. >What modifications are you making to /etc/my.cnf and why >do they turn the results around the other way? I used either my-huge.cnf or no config file at all (as noted in the benchmarks). Tell me all the FreeBSD tests you want to see & I'll do them if I can. From owner-freebsd-threads@FreeBSD.ORG Sat May 22 21:40:45 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9E6CB16A4CE for ; Sat, 22 May 2004 21:40:45 -0700 (PDT) Received: from sccrmhc12.comcast.net (sccrmhc12.comcast.net [204.127.202.56]) by mx1.FreeBSD.org (Postfix) with ESMTP id 528E043D1D for ; Sat, 22 May 2004 21:40:44 -0700 (PDT) (envelope-from julian@elischer.org) Received: from interjet.elischer.org ([24.7.73.28]) by comcast.net (sccrmhc12) with ESMTP id <2004052304402101200fkebje>; Sun, 23 May 2004 04:40:26 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id VAA05663; Sat, 22 May 2004 21:40:20 -0700 (PDT) Date: Sat, 22 May 2004 21:40:18 -0700 (PDT) From: Julian Elischer To: JG In-Reply-To: <5.2.0.9.2.20040522212217.01511190@mail.ojoink.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 04:40:45 -0000 On Sat, 22 May 2004, JG wrote: > > > >Along with the other benchmarks it's still a little apples > >and oranges. I've seen different versions of mysql run > >with different versions of FreeBSD. > > I'm going to stick with 4.0.20 from now for tests. > > Most of my tests were done on 4.0.20. > > > > I'd like to see the > >same mysql version run on the same hardware with libpthread > >and linuxthreads. > > I'll have to do that on the i386 install tomorrow, as Linuxthreads > is not available for FreeBSD/AMD64. > > > >This shows that -current (both SMP and UP) with libpthread is > >faster than linuxthreads (different versions of FreeBSD and > >mysql, though). > > For FreeBSD nothing (remote) has been faster than the i386 Linuxthreads > test. > > I'll do everything local tomorrow. > > > >Also, if you use the default mysql config settings, then > >FreeBSD remote vs Linuxthreads remote also wins (2685.53 > >vs. 2091.10 from earlier post). > > I understand what you're saying, but those numbers are horrible. > > > >What modifications are you making to /etc/my.cnf and why > >do they turn the results around the other way? > > I used either my-huge.cnf or no config file at all (as noted in the > benchmarks). > > > > For a start there are the following variations to try: SCHED_ULE vs SCHED_4BSD SCOPE_SYSTEM vs SCOPE_PROCESS threads > Tell me all the FreeBSD tests you want to see & I'll do them if I can. > > > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to "freebsd-threads-unsubscribe@freebsd.org" > From owner-freebsd-threads@FreeBSD.ORG Sat May 22 22:39:32 2004 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 70C1216A4CE for ; Sat, 22 May 2004 22:39:32 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 51B4743D46; Sat, 22 May 2004 22:39:32 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from freebsd.org (davidxu@localhost [127.0.0.1]) i4N5dRHW017863; Sat, 22 May 2004 22:39:28 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <40B038B4.4030207@freebsd.org> Date: Sun, 23 May 2004 13:37:56 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040522 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-threads@freebsd.org Subject: Re: Why is MySQL nearly twice as fast on Linux? X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 May 2004 05:39:32 -0000 Daniel Eischen wrote: >On Sat, 22 May 2004, JG wrote: > > >>>Do you have any suggestions or ideas as to what the problem is? >>> >>> > >[...] > > > >>(Compiled with libpthread) >> >>Also w/ http://people.freebsd.org/~deischen/mysql40-server.diffs patch. >>------------------------------------------------------------------------- >> >>BENCHMARK RESULTS: >> >>Local test: >> >>- Using AMD64-4BSD SMP kernel w/SCHED_4BSD >>- Using default mysql config (no config file) >> >>amd64f# super-smack update-select.smack 30 10000 >>Query Barrel Report for client smacker >>connect: max=25ms min=4ms avg= 15ms from 30 clients >>Query_type num_queries max_time min_time q_per_s >>select_index 300000 11 0 2819.41 >>update_index 300000 7 0 2819.41 >> >> >>- Using AMD64-4BSD-NOSMP SINGLE CPU kernel w/SCHED_4BSD >>- Using default mysql config (no config file) >> >>amd64f# super-smack update-select.smack 30 10000 >>Query Barrel Report for client smacker >>connect: max=21ms min=9ms avg= 16ms from 30 clients >>Query_type num_queries max_time min_time q_per_s >>select_index 300000 5 0 3015.96 >>update_index 300000 23 5 3015.96 >> >> > >Along with the other benchmarks it's still a little apples >and oranges. I've seen different versions of mysql run >with different versions of FreeBSD. I'd like to see the >same mysql version run on the same hardware with libpthread >and linuxthreads. What I've seen so far is close WRT >OS and mysql versions, but still not the same: > > mysql-4.1.1-alpha on FreeBSD 5.2-RELEASE with linuxthreads, > SCHED4_BSD, amd32 > ---------------------------------------------------------- > Local: > > - Using default mysql config settings (empty/missing my.cnf) > - Using SCHED_4BSD kernel > > amd32f# super-smack update-select.smack 30 10000 > Query Barrel Report for client smacker > connect: max=19ms min=12ms avg= 14ms from 30 clients > Query_type num_queries max_time min_time q_per_s > select_index 300000 9 0 2589.28 > update_index 300000 7 0 2589.28 > > > mysql-4.0.20 (with process-scope patch) on FreeBSD 5.2-current > with libpthread, SCHED4_BSD, amd64 > -------------------------------------------------------------- > 2819.41 (SMP), 3015.96 (UP), see quoted email above > >This shows that -current (both SMP and UP) with libpthread is >faster than linuxthreads (different versions of FreeBSD and >mysql, though). > >Also, if you use the default mysql config settings, then >FreeBSD remote vs Linuxthreads remote also wins (2685.53 >vs. 2091.10 from earlier post). > >What modifications are you making to /etc/my.cnf and why >do they turn the results around the other way? > > > I have done a test. The machine is Athlon XP 3000+ with KT600 chipsets. MySQL with libpthread using scope process thread has best peformance, it gets 3200 q_per_s while scope system only gets 2900 q_per_s. Linuxthreads gets 3100 q_per_s, and this is same with libthr. I don't have /etc/my.cnf installed. David Xu