From owner-freebsd-stable@FreeBSD.ORG Thu May 8 11:37:02 2008 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21A871065678 for ; Thu, 8 May 2008 11:37:02 +0000 (UTC) (envelope-from petefrench@ticketswitch.com) Received: from angel.ticketswitch.com (angel.ticketswitch.com [IPv6:2002:57e0:1d4e::1]) by mx1.freebsd.org (Postfix) with ESMTP id CFD2A8FC1B for ; Thu, 8 May 2008 11:37:01 +0000 (UTC) (envelope-from petefrench@ticketswitch.com) Received: from [10.50.50.2] (helo=smaug.rattatosk) by angel.ticketswitch.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ju4Qm-0005pB-Co for freebsd-stable@freebsd.org; Thu, 08 May 2008 12:37:00 +0100 Received: from dilbert.rattatosk ([10.50.50.6] helo=dilbert.ticketswitch.com) by smaug.rattatosk with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ju4Qm-000Dhl-AT for freebsd-stable@freebsd.org; Thu, 08 May 2008 12:37:00 +0100 Received: from petefrench by dilbert.ticketswitch.com with local (Exim 4.69 (FreeBSD)) (envelope-from ) id 1Ju4Qm-0005iL-7C for freebsd-stable@freebsd.org; Thu, 08 May 2008 12:37:00 +0100 To: freebsd-stable@freebsd.org Message-Id: From: Pete French Date: Thu, 08 May 2008 12:37:00 +0100 Subject: Re: Dreadful gmirror performance - suggested changes to 'prefer' X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 May 2008 11:37:02 -0000 I am just looking at this again, and am in a bit of a mood for writing some patches, so I wanted to run the following idea past people as regards the priority system in the 'prefer' balancing method. Just to recap, creating a gmirror creates the first device with priority zero. Adding extra devices lets you set their priorities, but you cant set negative values. The upshot is that the first device in the mirror always has the lowest priority - so you cannot (for example) create a mirror with a local disc, subsequently add a remote disc, but then set the mirror up to prefer the local drive. I am thinking of a couple of changes - the first being the patch prroposed from Andrew Snow which would create the mirror with the priority at something other than zero (128 would be my preference) so that extra devices can be inserted both above and below it. This solves the problem for newly created mirrors as the priority can then be set as appropiate. The other change I wanted to make was to add a second 'prefer' mode to gmirror though - one which would prefer the *lowest* priority instead of the highest priority. I would probably rename the existing mode to 'prefer-high' (keeping 'prefer' as a synonym for backward compatibility) and add a 'prefer-low' as well. As an existing gmirror can have it's load balance algorithm changed on the fly, this lets you change which of the drives is preferred in an existing installationg. This is precisely what you need when switching between two machines so that the local and remote drives become reversed. I havent looked at the code in detail, but I can't see that it would be too difficult. What do people think ? -pete.