All of lore.kernel.org
 help / color / mirror / Atom feed
* stripe_cache_active always 0
@ 2016-01-07  3:09 Adam Goryachev
  2016-01-07 16:34 ` Robert Kierski
  0 siblings, 1 reply; 4+ messages in thread
From: Adam Goryachev @ 2016-01-07  3:09 UTC (permalink / raw)
  To: linux-raid

I remember some years ago when I was building my storage servers I spent 
a lot of time optimising performance, and eventually got some really 
good stats and more importantly, good enough performance that users 
stopped complaining, and things "just work".

However, when comparing config with another server, I noticed one of the 
values I configured was stripe_cache_size, and I was setting this to 
4096 (which was the peak performance compared to higher/lower numbers at 
the time).

In any case, I'm looking at a "in use" system, and looking at 
stripe_cache_active and it is always 0. I'm trying to find some docs on 
what this value means?
Is the stripe cache disabled?
Are there just no stripes in the cache?

If it is always 0, then does it mean I don't need to adjust the 
stripe_cache_size (I presume worst case is I am wasting RAM which is not 
really important anyway).

Thanks,
Adam

-- 
Adam Goryachev
Website Managers
P: +61 2 8304 0000                    adam@websitemanagers.com.au
F: +61 2 8304 0001                     www.websitemanagers.com.au


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

* RE: stripe_cache_active always 0
  2016-01-07  3:09 stripe_cache_active always 0 Adam Goryachev
@ 2016-01-07 16:34 ` Robert Kierski
  2016-01-07 17:52   ` Roman Mamedov
  2016-01-07 17:53   ` {Possible Spam} " Benjamin ESTRABAUD
  0 siblings, 2 replies; 4+ messages in thread
From: Robert Kierski @ 2016-01-07 16:34 UTC (permalink / raw)
  To: Adam Goryachev, linux-raid

Adam,

stripe_cache_active is the value to indicate how many pages are currently in use in the stripe cache.  I could be wrong about this... but I don’t think you can disable the stripe cache.  You can shrink it to an unreasonable size, but the minimum you can set stripe_cache_size to is 17 (pages).

Having said that, it may be that your RAID isn't using the stripe cache or that you're not checking the value frequently enough to see stripe cache activity.

A file system that is properly tuned, and doing buffered IO will likely reduce the stripe cache usage.  The stripe cache is basically where data gets put when the RAID is doing partial stripe IO's, calculating parity, or waiting for slow devices to complete their IO's.  It's not intended to be yet another level of cache, so it gets purged when the RAID is done with it.  So, unlike other caches that will hold onto data until there is memory pressure, the stripe cache is more likely to be empty.

As far as adjusting stripe_cache_size... The stripe cache is dynamically allocated.  It won't save any RAM by decreasing stripe_cache_size.  Decreasing it too much will negatively impact performance as it's more likely you'll do Read-Modify-Write's when doing partial stripe writes.

Bob Kierski
Senior Storage Performance Engineer
Cray Inc.
380 Jackson Street
Suite 210
St. Paul, MN 55101
Tele: 651-967-9590
Fax:  651-605-9001
Cell: 651-890-7461


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

* Re: stripe_cache_active always 0
  2016-01-07 16:34 ` Robert Kierski
@ 2016-01-07 17:52   ` Roman Mamedov
  2016-01-07 17:53   ` {Possible Spam} " Benjamin ESTRABAUD
  1 sibling, 0 replies; 4+ messages in thread
From: Roman Mamedov @ 2016-01-07 17:52 UTC (permalink / raw)
  To: Robert Kierski; +Cc: Adam Goryachev, linux-raid

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

On Thu, 7 Jan 2016 16:34:36 +0000
Robert Kierski <rkierski@cray.com> wrote:

> As far as adjusting stripe_cache_size... The stripe cache is dynamically allocated.  It won't save any RAM by decreasing stripe_cache_size.

Since when?

# echo 512 > /sys/devices/virtual/block/md0/md/stripe_cache_size
# free
             total       used       free     shared    buffers     cached
Mem:      16159912   15672696     487216      12588         52   14484708
-/+ buffers/cache:    1187936   14971976
Swap:            0          0          0

# echo 32768 > /sys/devices/virtual/block/md0/md/stripe_cache_size
# free
             total       used       free     shared    buffers     cached
Mem:      16159912   15957880     202032      12588         52   14214952
-/+ buffers/cache:    1742876   14417036
Swap:            0          0          0

You can see that's not the case (on kernel 4.3.3 with four-member RAID5);

And it's quite easy to rapidly hit OOM issues on high-member-count arrays by
setting stripe_cache_size to larger values (not realizing that this is *in
pages* not kilobytes or sectors, and *per disk*).

As for the original question, try checking stripe_cache_active e.g. once
per second during heavy write load to the filesystem.

-- 
With respect,
Roman

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: {Possible Spam} RE: stripe_cache_active always 0
  2016-01-07 16:34 ` Robert Kierski
  2016-01-07 17:52   ` Roman Mamedov
@ 2016-01-07 17:53   ` Benjamin ESTRABAUD
  1 sibling, 0 replies; 4+ messages in thread
From: Benjamin ESTRABAUD @ 2016-01-07 17:53 UTC (permalink / raw)
  To: Robert Kierski, Adam Goryachev, linux-raid

On 07/01/16 16:34, Robert Kierski wrote:
> Adam,
>
> stripe_cache_active is the value to indicate how many pages are currently in use in the stripe cache.  I could be wrong about this... but I don’t think you can disable the stripe cache.  You can shrink it to an unreasonable size, but the minimum you can set stripe_cache_size to is 17 (pages).
>
> Having said that, it may be that your RAID isn't using the stripe cache or that you're not checking the value frequently enough to see stripe cache activity.
>
> A file system that is properly tuned, and doing buffered IO will likely reduce the stripe cache usage.  The stripe cache is basically where data gets put when the RAID is doing partial stripe IO's, calculating parity, or waiting for slow devices to complete their IO's.  It's not intended to be yet another level of cache, so it gets purged when the RAID is done with it.  So, unlike other caches that will hold onto data until there is memory pressure, the stripe cache is more likely to be empty.
>
> As far as adjusting stripe_cache_size... The stripe cache is dynamically allocated.  It won't save any RAM by decreasing stripe_cache_size.  Decreasing it too much will negatively impact performance as it's more likely you'll do Read-Modify-Write's when doing partial stripe writes.
>
I find that tuning it a bit higher (but not too high) has a very 
positive impact on rebuild times (where we are therefore building 
stripes). I can't remember exactly the values but we were setting it to 
256 or 512 or even 1024 while building RAID5 or 6 with positive results.

Regards,
Ben.

> Bob Kierski
> Senior Storage Performance Engineer
> Cray Inc.
> 380 Jackson Street
> Suite 210
> St. Paul, MN 55101
> Tele: 651-967-9590
> Fax:  651-605-9001
> Cell: 651-890-7461
>
> N�����r��y���b�X��ǧv�^�)޺{.n�+����{�����{ay�\x1dʇڙ�,j\a��f���h���z�\x1e�w���\f���j:+v���w�j�m����\a����zZ+�����ݢj"��!tml=
>

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2016-01-07 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-07  3:09 stripe_cache_active always 0 Adam Goryachev
2016-01-07 16:34 ` Robert Kierski
2016-01-07 17:52   ` Roman Mamedov
2016-01-07 17:53   ` {Possible Spam} " Benjamin ESTRABAUD

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.