From owner-freebsd-hackers Mon Jan 10 16:46:10 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 66DDE153BE for ; Mon, 10 Jan 2000 16:46:00 -0800 (PST) (envelope-from bright@fw.wintelcom.net) Received: (from bright@localhost) by fw.wintelcom.net (8.9.3/8.9.3) id RAA27032; Mon, 10 Jan 2000 17:08:22 -0800 (PST) Date: Mon, 10 Jan 2000 17:08:22 -0800 From: Alfred Perlstein To: Matthew Dillon Cc: Scott Hess , freebsd-hackers@FreeBSD.ORG, developer@lists.mysql.com Subject: Re: Concept check: iothreads addition to pthreads for MYSQL+FreeBSD. Message-ID: <20000110170822.J9397@fw.wintelcom.net> References: <1a6101bf5bc1$4e364b20$1e80000a@avantgo.com> <200001102336.PAA31453@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <200001102336.PAA31453@apollo.backplane.com>; from dillon@apollo.backplane.com on Mon, Jan 10, 2000 at 03:36:23PM -0800 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * Matthew Dillon [000110 16:04] wrote: > :Recently I was tasked to find a way to scale up our MYSQL server, running > :MYSQL3.22.15 on FreeBSD3.3. I've been testing a hardware RAID solution, > :and found that with 6 disks in a RAID5 configuration, the system was only > :perhaps 30% faster than when running on a single disk. [The 6 disks in the > :RAID5 are the same model as the single-disk test I was comparing against.] > : > :Experimentation determined that pthreads was the problem. FreeBSD's > :implementation of pthreads using a select() loop, and select() always says > :that disk I/O is ready to proceed, and disk I/O never return EWOULDBLOCK. > :Essentially, pthreads was serializing the MYSQL read() requests, and if the > :dataset exceeds memory size, performance becomes entirely seek bound. > : > :I've implemented a rough fix, which is to rfork() processes which I label > :... > :Thanks, > :scott > > A better solution may be to shift to FreeBSD4.0 (when it's released - > wait for it to become good and stable), and then use the native > linuxthreads port (/usr/ports/devel/linuxthreads) for FreeBSD. > > The linuxthreads port is at least four times faster and, since it uses > rfork(), will be I/O optimal. However, since only FreeBSD-4.x implements > rfork(...RF_MEM) you can only use it with FreeBSD-4.x (or am I wrong > there?). I'm pretty sure RF_MEM doesn't work in 3.x with SMP, under UP it should work fine. -Alfred To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message