All of lore.kernel.org
 help / color / mirror / Atom feed
* understanding speculative preallocation
@ 2013-07-26  7:23 jbr
  2013-07-26 11:50 ` Dave Chinner
  0 siblings, 1 reply; 47+ messages in thread
From: jbr @ 2013-07-26  7:23 UTC (permalink / raw)
  To: xfs

Hello,

I'm looking for general documentation/help with the speculative
preallocation feature in xfs.  So far, I haven't really been able to find
any definitive, up to date documentation on it.

I'm wondering how I can find out definitively which version of xfs I am
using, and what the preallocation scheme in use is.

We are running apache kafka on our servers, and kafka uses sequential io to
write data log files.  Kafka uses, by default, a maximum log file size of
1Gb.  However, most of the log files end up being 2Gb, and thus the disk
fills up twice as fast as it should.

We are using xfs on CentOS 2.6.32-358.  Is there a way I can know which
version of xfs is built into this version of the kernel?  What preallocation
schedule does it use?  If I do a xfs_info -V, it reports 3.1.1.

We are using xfs (mounted with no allocsize specified).  I've seen varying
info suggesting this means it either defaults to an allocsize of 64K (which
doesn't seem to match my observations), or that it will use dynamic
preallocation.

I've also seen hints (but no actual canonical documentation) suggesting that
the dynamic preallocation works by progressively doubling the current file
size (which does match my observations).

What I'm not clear on, is the scheduling for the preallocation. At what
point does it decide to preallocate the next doubling of space.  Is it when
the current preallocated space is used up, or does it happen when the
current space is used up within some threshold.  What I'd like to do, is
keep the doubling behavior in tact, but have it capped so it never increases
the file beyond 1Gb.  Is there a way to do that?  Can I trick the
preallocation to not do a final doubling, if I cap my kafka log files at
say, 900Mb (or some percentage under 1Gb)?

There are numerous references to an allocation schedule like this:

freespace       max prealloc size
  >5%             full extent (8GB)
  4-5%             2GB (8GB >> 2)
  3-4%             1GB (8GB >> 3)
  2-3%           512MB (8GB >> 4)
  1-2%           256MB (8GB >> 5)
  <1%            128MB (8GB >> 6)

I'm just not sure I understand what this is telling me.  It seems to tell me
what the max prealloc size is, with being reduced if the disk is nearly
full.  But it doesn't tell me about the progressive doubling in
preallocation (I assume up to a max of 8Gb).  Is any of this configurable? 
Can we specify a max prealloc size somewhere?

The other issue seems to be that after the files are closed (from within the
java jvm), they still don't seem to have their pre-allocated space
reclaimed.  Are there known issues with closing the files in java not
properly causing a flush of the preallocated space?

Any help pointing me to any documentation/user guides which accurately
describes this would be appreciated!

Thanks,

Jason



--
View this message in context: http://xfs.9218.n7.nabble.com/understanding-speculative-preallocation-tp35002.html
Sent from the Xfs - General mailing list archive at Nabble.com.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 47+ messages in thread
* understanding speculative preallocation
@ 2013-07-26  7:35 jbr
  0 siblings, 0 replies; 47+ messages in thread
From: jbr @ 2013-07-26  7:35 UTC (permalink / raw)
  To: linux-xfs

Hello, 

I'm looking for general documentation/help with the speculative
preallocation feature in xfs.  So far, I haven't really been able to find
any definitive, up to date documentation on it. 

I'm wondering how I can find out definitively which version of xfs I am
using, and what the preallocation scheme in use is. 

We are running apache kafka on our servers, and kafka uses sequential io to
write data log files.  Kafka uses, by default, a maximum log file size of
1Gb.  However, most of the log files end up being 2Gb, and thus the disk
fills up twice as fast as it should. 

We are using xfs on CentOS 2.6.32-358.  Is there a way I can know which
version of xfs is built into this version of the kernel?  What preallocation
schedule does it use?  If I do a xfs_info -V, it reports 3.1.1. 

We are using xfs (mounted with no allocsize specified).  I've seen varying
info suggesting this means it either defaults to an allocsize of 64K (which
doesn't seem to match my observations), or that it will use dynamic
preallocation. 

I've also seen hints (but no actual canonical documentation) suggesting that
the dynamic preallocation works by progressively doubling the current file
size (which does match my observations). 

What I'm not clear on, is the scheduling for the preallocation. At what
point does it decide to preallocate the next doubling of space.  Is it when
the current preallocated space is used up, or does it happen when the
current space is used up within some threshold.  What I'd like to do, is
keep the doubling behavior in tact, but have it capped so it never increases
the file beyond 1Gb.  Is there a way to do that?  Can I trick the
preallocation to not do a final doubling, if I cap my kafka log files at
say, 900Mb (or some percentage under 1Gb)? 

There are numerous references to an allocation schedule like this: 

freespace       max prealloc size 
  >5%             full extent (8GB) 
  4-5%             2GB (8GB >> 2) 
  3-4%             1GB (8GB >> 3) 
  2-3%           512MB (8GB >> 4) 
  1-2%           256MB (8GB >> 5) 
  <1%            128MB (8GB >> 6) 

I'm just not sure I understand what this is telling me.  It seems to tell me
what the max prealloc size is, with being reduced if the disk is nearly
full.  But it doesn't tell me about the progressive doubling in
preallocation (I assume up to a max of 8Gb).  Is any of this configurable? 
Can we specify a max prealloc size somewhere? 

The other issue seems to be that after the files are closed (from within the
java jvm), they still don't seem to have their pre-allocated space
reclaimed.  Are there known issues with closing the files in java not
properly causing a flush of the preallocated space? 

Any help pointing me to any documentation/user guides which accurately
describes this would be appreciated! 

Thanks, 

Jason



--
View this message in context: http://xfs.9218.n7.nabble.com/understanding-speculative-preallocation-tp35003.html
Sent from the linux-xfs mailing list archive at Nabble.com.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2013-08-14 17:02 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-26  7:23 understanding speculative preallocation jbr
2013-07-26 11:50 ` Dave Chinner
2013-07-26 17:40   ` Jason Rosenberg
2013-07-26 19:27     ` Stan Hoeppner
2013-07-26 19:43       ` A short digression on FOSS (Re: understanding speculative preallocation) Jay Ashworth
2013-07-27  3:52         ` Stan Hoeppner
2013-07-27 21:00           ` Jay Ashworth
2013-07-28  1:38             ` aurfalien
2013-07-28  1:50               ` Jay Ashworth
2013-07-28  2:08                 ` aurfalien
2013-07-28  2:21                   ` Jay Ashworth
2013-07-28  5:09                     ` Purpose of the XFS list -- was: " Stan Hoeppner
2013-07-28 15:45                       ` Jay Ashworth
2013-08-14 17:01                         ` Emmanuel Florac
2013-07-28  7:18                     ` Stefan Ring
2013-07-28 15:48                       ` Jay Ashworth
2013-07-29  0:02                       ` Dave Chinner
2013-07-29  0:06                         ` Jay Ashworth
2013-07-29  2:41                           ` Dave Chinner
2013-07-29  3:12                             ` Eric Sandeen
2013-07-29  4:11                               ` Stan Hoeppner
2013-07-29 14:33                                 ` Jay Ashworth
2013-07-29 15:25                                   ` Dave Howorth
2013-07-29  3:38                             ` Keith Keller
2013-07-29  4:32                               ` Eric Sandeen
2013-07-29  4:57                                 ` Keith Keller
2013-07-29 13:38                                   ` Eric Sandeen
2013-07-29 18:15                                     ` Keith Keller
2013-07-29 14:24                             ` Jay Ashworth
2013-07-29 14:36                               ` Jay Ashworth
2013-07-29 14:57                               ` Eric Sandeen
2013-07-29 15:30                                 ` Jay Ashworth
2013-07-29 17:05                                   ` Eric Sandeen
2013-07-29  0:00                     ` Dave Chinner
2013-07-28  5:15             ` Michael L. Semon
2013-07-26 20:38       ` understanding speculative preallocation Jason Rosenberg
2013-07-26 20:50         ` Ben Myers
2013-07-26 21:04           ` Jason Rosenberg
2013-07-26 21:11             ` Jason Rosenberg
2013-07-26 21:42               ` Ben Myers
2013-07-27  1:30               ` Dave Chinner
2013-07-28  2:19                 ` Jason Rosenberg
2013-07-29  0:04                   ` Dave Chinner
2013-07-26 21:45         ` Eric Sandeen
2013-07-27  4:26       ` Keith Keller
2013-07-27  1:26     ` Dave Chinner
2013-07-26  7:35 jbr

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.