diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-09-26 12:31:15 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-10-01 12:39:36 -0700 |
commit | dd8eb06e26138e149252365043706067782416af (patch) | |
tree | 64336015b9ae4588249dc0e4b6a6eeed67884d2a /xlators/cluster/afr/src/afr.c | |
parent | 947523a74c97b057b8bcfdf2c65943495ab118d2 (diff) |
cluster/afr: Provide option to set readdir-size in entry-self-heal
Problem:
Entry self-heal does lookups on all the entries that are read
in readdir. More the size of readdir more number of lookups happen
in parallel. It is observed that it leads to HUGE cpu spikes
rendering everything else on the system unusable.
Fix:
Provided the option self-heal-readdir-size to configure the size.
Default value is at 1KB.
Tests:
Checked that the readdirs are happening with the configured value
in entry-self-heal.
Change-Id: Icaa937ad88857e6f9a12375b1e7f6a49192bc8b1
BUG: 860895
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.org/4002
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r-- | xlators/cluster/afr/src/afr.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 77f00ef72..ea686dfde 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -186,6 +186,8 @@ reconfigure (xlator_t *this, dict_t *options) GF_OPTION_RECONF ("post-op-delay-secs", priv->post_op_delay_secs, options, uint32, out); + GF_OPTION_RECONF (AFR_SH_READDIR_SIZE_KEY, priv->sh_readdir_size, + options, size, out); /* Reset this so we re-discover in case the topology changed. */ priv->did_discovery = _gf_false; @@ -325,6 +327,8 @@ init (xlator_t *this) GF_OPTION_INIT ("eager-lock", priv->eager_lock, bool, out); GF_OPTION_INIT ("quorum-type", qtype, str, out); GF_OPTION_INIT ("quorum-count", priv->quorum_count, uint32, out); + GF_OPTION_INIT (AFR_SH_READDIR_SIZE_KEY, priv->sh_readdir_size, size, + out); fix_quorum_options(this,priv,qtype); GF_OPTION_INIT ("post-op-delay-secs", priv->post_op_delay_secs, uint32, out); @@ -672,5 +676,12 @@ struct volume_options options[] = { "post-operation phase of the transaction to " "enhance overlap of adjacent write operations.", }, + { .key = {AFR_SH_READDIR_SIZE_KEY}, + .type = GF_OPTION_TYPE_SIZET, + .description = "readdirp size for performing entry self-heal", + .min = 1024, + .max = 131072, + .default_value = "1KB", + }, { .key = {NULL} }, }; |