From owner-freebsd-performance@FreeBSD.ORG Tue Jun 27 03:34:19 2006 Return-Path: X-Original-To: freebsd-performance@freebsd.org Delivered-To: freebsd-performance@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0253116A405 for ; Tue, 27 Jun 2006 03:34:19 +0000 (UTC) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id C0BB543D6B for ; Tue, 27 Jun 2006 03:34:13 +0000 (GMT) (envelope-from grog@lemis.com) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id E1B229B482; Tue, 27 Jun 2006 13:04:12 +0930 (CST) Date: Tue, 27 Jun 2006 13:04:12 +0930 From: Greg 'groggy' Lehey To: leo huang Message-ID: <20060627033412.GQ10845@wantadilla.lemis.com> References: <14a4a8480606261918q39b51f7bkd69958c5a7b05021@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U/5EjKfnYgGK6hcj" Content-Disposition: inline In-Reply-To: <14a4a8480606261918q39b51f7bkd69958c5a7b05021@mail.gmail.com> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-performance@freebsd.org Subject: Re: Is the fsync() fake on FreeBSD6.1? X-BeenThere: freebsd-performance@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Performance/tuning List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 03:34:19 -0000 --U/5EjKfnYgGK6hcj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tuesday, 27 June 2006 at 10:18:47 +0800, leo huang wrote: > Hi, > > I benchmarked MySQL 4.1.18 on FreeBSD 6.1 and Debian 3.1 using Super Smack > 1.3 some days ago. > > ... > > The result surprise me. The MySQL Performance on FreeBSD6.1 is about > 10 times of on Debian3.1??and the output of iostat also shows it. > > I know that MySQL uses fsync() to flush both the data and log files > at default when using innodb engine( > http://dev.mysql.com/doc/refman/4.1/en/innodb-parameters.html). Our > evaluating computer only has a 10000RPM SCSI hard disk. I think it > can do about 200 sequential fsync() calls per second if the fsync() > is real. > > Is the fsync() on FreeBSD6.1 fake? My understanding from the last time I looked at the code was that fsync does the right thing: The fsync() system call causes all modified data and attributes of fd to be moved to a permanent storage device. This normally results in all in- core modified copies of buffers for the associated file to be written to a disk. This is not the case for Linux, where fsync syncs the entire file system. That could explain some of the performance difference, but not all of it. I suppose it's worth noting that, in general, people report much better performance with MySQL on Linux than on FreeBSD. > I mean than the data is only written to the drives memory and so can > be lost if power goes down. I don't believe that fsync is required to flush the drive buffers. It would be nice to have a function that did, though. > And how I can confirm this? Trial and error? Greg -- See complete headers for address and phone numbers. --U/5EjKfnYgGK6hcj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEoKc0IubykFB6QiMRAuteAKCHeyDhqwRJxhOPrJnGps4o+xnqbACdHJpU Mvsi7Crmh6+JcQtJAmGoZR4= =Wad+ -----END PGP SIGNATURE----- --U/5EjKfnYgGK6hcj--