mirror of
https://github.com/ceph/ceph
synced 2025-02-23 11:07:35 +00:00
osd: instrument osdmap bl cache hits and misses
Add perfcounters so we can see whether we are missing osdmaps in the cache. This will let us tell whether, given a workload or environment, our osdmap cache might be too small. Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
0ff3d4291c
commit
73985a5b10
@ -1395,8 +1395,13 @@ void OSDService::send_incremental_map(epoch_t since, Connection *con,
|
|||||||
bool OSDService::_get_map_bl(epoch_t e, bufferlist& bl)
|
bool OSDService::_get_map_bl(epoch_t e, bufferlist& bl)
|
||||||
{
|
{
|
||||||
bool found = map_bl_cache.lookup(e, &bl);
|
bool found = map_bl_cache.lookup(e, &bl);
|
||||||
if (found)
|
if (found) {
|
||||||
|
if (logger)
|
||||||
|
logger->inc(l_osd_map_bl_cache_hit);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
if (logger)
|
||||||
|
logger->inc(l_osd_map_bl_cache_miss);
|
||||||
found = store->read(coll_t::meta(),
|
found = store->read(coll_t::meta(),
|
||||||
OSD::get_osdmap_pobject_name(e), 0, 0, bl) >= 0;
|
OSD::get_osdmap_pobject_name(e), 0, 0, bl) >= 0;
|
||||||
if (found)
|
if (found)
|
||||||
@ -1408,8 +1413,13 @@ bool OSDService::get_inc_map_bl(epoch_t e, bufferlist& bl)
|
|||||||
{
|
{
|
||||||
Mutex::Locker l(map_cache_lock);
|
Mutex::Locker l(map_cache_lock);
|
||||||
bool found = map_bl_inc_cache.lookup(e, &bl);
|
bool found = map_bl_inc_cache.lookup(e, &bl);
|
||||||
if (found)
|
if (found) {
|
||||||
|
if (logger)
|
||||||
|
logger->inc(l_osd_map_bl_cache_hit);
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
if (logger)
|
||||||
|
logger->inc(l_osd_map_bl_cache_miss);
|
||||||
found = store->read(coll_t::meta(),
|
found = store->read(coll_t::meta(),
|
||||||
OSD::get_inc_osdmap_pobject_name(e), 0, 0, bl) >= 0;
|
OSD::get_inc_osdmap_pobject_name(e), 0, 0, bl) >= 0;
|
||||||
if (found)
|
if (found)
|
||||||
@ -2915,6 +2925,7 @@ void OSD::create_logger()
|
|||||||
osd_plb.add_u64_counter(
|
osd_plb.add_u64_counter(
|
||||||
l_osd_waiting_for_map, "messages_delayed_for_map",
|
l_osd_waiting_for_map, "messages_delayed_for_map",
|
||||||
"Operations waiting for OSD map");
|
"Operations waiting for OSD map");
|
||||||
|
|
||||||
osd_plb.add_u64_counter(
|
osd_plb.add_u64_counter(
|
||||||
l_osd_map_cache_hit, "osd_map_cache_hit", "osdmap cache hit");
|
l_osd_map_cache_hit, "osd_map_cache_hit", "osdmap cache hit");
|
||||||
osd_plb.add_u64_counter(
|
osd_plb.add_u64_counter(
|
||||||
@ -2925,6 +2936,12 @@ void OSD::create_logger()
|
|||||||
osd_plb.add_u64_avg(
|
osd_plb.add_u64_avg(
|
||||||
l_osd_map_cache_miss_low_avg, "osd_map_cache_miss_low_avg",
|
l_osd_map_cache_miss_low_avg, "osd_map_cache_miss_low_avg",
|
||||||
"osdmap cache miss, avg distance below cache lower bound");
|
"osdmap cache miss, avg distance below cache lower bound");
|
||||||
|
osd_plb.add_u64_counter(
|
||||||
|
l_osd_map_bl_cache_hit, "osd_map_bl_cache_hit",
|
||||||
|
"OSDMap buffer cache hits");
|
||||||
|
osd_plb.add_u64_counter(
|
||||||
|
l_osd_map_bl_cache_miss, "osd_map_bl_cache_miss",
|
||||||
|
"OSDMap buffer cache misses");
|
||||||
|
|
||||||
osd_plb.add_u64(l_osd_stat_bytes, "stat_bytes", "OSD size");
|
osd_plb.add_u64(l_osd_stat_bytes, "stat_bytes", "OSD size");
|
||||||
osd_plb.add_u64(l_osd_stat_bytes_used, "stat_bytes_used", "Used space");
|
osd_plb.add_u64(l_osd_stat_bytes_used, "stat_bytes_used", "Used space");
|
||||||
|
@ -131,6 +131,8 @@ enum {
|
|||||||
l_osd_map_cache_miss,
|
l_osd_map_cache_miss,
|
||||||
l_osd_map_cache_miss_low,
|
l_osd_map_cache_miss_low,
|
||||||
l_osd_map_cache_miss_low_avg,
|
l_osd_map_cache_miss_low_avg,
|
||||||
|
l_osd_map_bl_cache_hit,
|
||||||
|
l_osd_map_bl_cache_miss,
|
||||||
|
|
||||||
l_osd_stat_bytes,
|
l_osd_stat_bytes,
|
||||||
l_osd_stat_bytes_used,
|
l_osd_stat_bytes_used,
|
||||||
|
Loading…
Reference in New Issue
Block a user