summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-20 22:52:24 -0700
committerSage Weil <sage@inktank.com>2013-09-23 14:56:45 -0700
commitdc7114e060a84fea603025a50998b5ea0bf6c682 (patch)
tree4fe4ae6b7f40bae72a49b141908c046363875bb6
parent08a97ae45f4df58a6a8ea8a6400934d860cf5eb4 (diff)
downloadceph-dc7114e060a84fea603025a50998b5ea0bf6c682.tar.gz
mon: warn if pg to osd ratio is too low
If there are not enough PGs relative to the number of in osds, warn. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/common/config_opts.h1
-rw-r--r--src/mon/PGMonitor.cc13
2 files changed, 14 insertions, 0 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h
index f6283239660..51212b5e4bf 100644
--- a/src/common/config_opts.h
+++ b/src/common/config_opts.h
@@ -158,6 +158,7 @@ OPTION(mon_timecheck_interval, OPT_FLOAT, 300.0) // on leader, timecheck (clock
OPTION(mon_accept_timeout, OPT_FLOAT, 10.0) // on leader, if paxos update isn't accepted
OPTION(mon_pg_create_interval, OPT_FLOAT, 30.0) // no more than every 30s
OPTION(mon_pg_stuck_threshold, OPT_INT, 300) // number of seconds after which pgs can be considered inactive, unclean, or stale (see doc/control.rst under dump_stuck for more info)
+OPTION(mon_pg_warn_min_per_osd, OPT_INT, 20) // min # pgs per (in) osd before we warn the admin
OPTION(mon_osd_full_ratio, OPT_FLOAT, .95) // what % full makes an OSD "full"
OPTION(mon_osd_nearfull_ratio, OPT_FLOAT, .85) // what % full makes an OSD near full
OPTION(mon_globalid_prealloc, OPT_INT, 100) // how many globalids to prealloc
diff --git a/src/mon/PGMonitor.cc b/src/mon/PGMonitor.cc
index 2a677be61d9..b27ba7749f4 100644
--- a/src/mon/PGMonitor.cc
+++ b/src/mon/PGMonitor.cc
@@ -1847,6 +1847,19 @@ void PGMonitor::get_health(list<pair<health_status_t,string> >& summary,
detail->push_back(make_pair(HEALTH_ERR, ss.str()));
}
}
+
+ // pg skew
+ int num_in = mon->osdmon()->osdmap.get_num_in_osds();
+ if (num_in && g_conf->mon_pg_warn_min_per_osd > 0) {
+ int per = pg_map.pg_stat.size() / num_in;
+ if (per < g_conf->mon_pg_warn_min_per_osd) {
+ ostringstream ss;
+ ss << "too few pgs per osd (" << per << " < min " << g_conf->mon_pg_warn_min_per_osd << ")";
+ summary.push_back(make_pair(HEALTH_WARN, ss.str()));
+ if (detail)
+ detail->push_back(make_pair(HEALTH_WARN, ss.str()));
+ }
+ }
}
void PGMonitor::check_full_osd_health(list<pair<health_status_t,string> >& summary,