All of lore.kernel.org
 help / color / mirror / Atom feed
From: Struan Bartlett <struan.bartlett@NewsNow.co.uk>
To: Hugo Mills <hugo-lkml@carfax.org.uk>, linux-btrfs@vger.kernel.org
Subject: Re: btrfs balancing start - and stop?
Date: Tue, 05 Apr 2011 17:06:11 +0100	[thread overview]
Message-ID: <4D9B3DF3.8090804@NewsNow.co.uk> (raw)
In-Reply-To: <20110401115935.GA2984@carfax.org.uk>


On 01/04/11 12:59, Hugo Mills wrote:
> On Fri, Apr 01, 2011 at 12:14:50PM +0100, Struan Bartlett wrote:
>    
>> My company is testing btrfs (kernel 2.6.38) on a slave MySQL
>> database server with a 195Gb filesystem (of which about 123Gb is
>> used). So far, we're quite impressed with the performance. Our
>> database loads are high, and if  filesystem performance wasn't good,
>> MySQL replication wouldn't be able to keep up and the slave latency
>> would begin to climb. This though, is generally not happening, which
>> is good.
>>
>> However, we recently tried running 'btrfs fi balance' on the
>> filesystem, and found this deteriorated performance significantly,
>> and the MySQL replication latency did begin to climb. Several hours
>> later, with the btrfs-cleaner thread apparently still busy, and our
>> replication latency running to a couple of hours, and no sign of the
>> balancing operation finishing, we decided we needed to terminate the
>> balancing operation, which we did by rebooting the server.
>>
>> That, however, is suboptimal in a production environment, and so
>> I've some questions.
>>
>> 1) Is the balancing operation expected to take many hours (or days?)
>> on a filesystem such as this? Or are there known issues with the
>> algorithm that are yet to be addressed?
>>      
>     A balance rewrites all the data on the filesystem, so it can take a
> very long time (I think the longest reported time I've seen from
> anyone was 48 hours, on several terabytes of data). However, this will
> be highly dependent on the amount of I/O bandwidth available to the
> FS, and on the size of the data to be written.
>
>    
>> 2) Is it supposed to be desirable to run balancing operations
>> periodically anyway? Our server is running on hardware mirrored
>> disks, so our btrfs filesystem is simply created in spare space on
>> the LVM volume group, using a single LV block device. Does balancing
>> help improve performance/optimise free space in this setup anyway?
>>      
>     Not that I'm aware of, particularly in the light of the recent
> patch that frees up unused block groups. Others here may have a more
> informed take on this, though.
>
>    
>> 3) If there's an ioctl for launching a balancing operation, would it
>> be an idea to add one for pausing a balancing operation? If
>> balancing may take 'significant' lengths of time, and if it's
>> intended that balancing be done periodically, it might be helpful if
>> one could start balancing when loads are lower, and make sure one
>> can stop them when resources are needed (in our case, when slave
>> latency exceeds acceptable limits).
>>      
>     There's patches for a cancel operation on the mailing list.
> Further, I've got (as yet) unreleased patches for various forms of
> partial balance, at least one of which would allow a balance to be
> restarted after it was cancelled. The only reason I've not released
> them is because I want to do a final check of what I send to the list
> to ensure that I'm not making an idiot of myself (and wasting people's
> time) with malformed patches. I hope to have time for this on Sunday.
>
>     Hugo.
>
>    
Hugo - thanks very much for your thorough reply. I look forward to being 
able to cancel a balancing operation, but in the meantime we simply 
won't bother setting any going, and see how things go. So far, our btrfs 
slave database has been running two weeks, with a rolling history of 
snapshots taken every ten minutes, without any other apparent issues.

Struan


  reply	other threads:[~2011-04-05 16:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 11:14 btrfs balancing start - and stop? Struan Bartlett
2011-04-01 11:59 ` Hugo Mills
2011-04-05 16:06   ` Struan Bartlett [this message]
2011-04-01 12:12 ` Helmut Hullen
2011-04-01 13:22   ` Konstantinos Skarlatos
2011-04-01 13:36     ` Helmut Hullen
2011-04-01 13:52       ` Hugo Mills
     [not found]     ` <20110401133736.GB2984@carfax.org.uk>
2011-04-01 14:24       ` Konstantinos Skarlatos
2011-04-01 18:33   ` Stephane Chazelas
2011-04-01 19:26     ` Helmut Hullen
2011-04-03 18:53       ` Stephane Chazelas
2011-04-03 19:35         ` Helmut Hullen
2011-04-04 19:07           ` Stephane Chazelas
2011-04-06 11:43             ` Stephane Chazelas
2011-04-11  8:42               ` Stephane Chazelas
2011-04-11  9:14                 ` Helmut Hullen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D9B3DF3.8090804@NewsNow.co.uk \
    --to=struan.bartlett@newsnow.co.uk \
    --cc=hugo-lkml@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.