[pve-devel] Ceph OSD latency changes

Waschb├╝sch IT-Services GmbH service at waschbuesch.it
Mon Aug 14 20:39:33 CEST 2017


Hi all,

In API2/Ceph.pm

osd latency information are read from the output of $get_osd_usage sub by running the monitor command 'pg dump'.
I don't know if this used to contain the latency information for each osd, but it does not in the current (luminous) tree.

I guess the information needs to be got from the output of 'osd perf'.
So, I guess this *should* do the trick. However, I do not have a development cluster up and running, so apologies for not being able to test this.



--- Ceph.pm.orig	2017-08-14 18:27:04.441035244 +0000
+++ Ceph.pm	2017-08-14 18:37:30.799198316 +0000
@@ -99,6 +99,13 @@
 	    $osdmetadata->{$osd->{id}} = $osd;
 	}

+	my $osdperfdata_tmp = $rados->mon_command({ prefix => 'osd perf' });
+
+	my $osdperfdata = {};
+	foreach my $osdperf (@$osdperfdata_tmp) {
+	    $osdperfdata->{$osdperf->{id}} = $osdperf;
+	}
+
 	my $nodes = {};
 	my $newnodes = {};
 	foreach my $e (@{$res->{nodes}}) {
@@ -122,12 +129,13 @@
 		$new->{total_space} = ($stat->{kb} || 1) * 1024;
 		$new->{bytes_used} = ($stat->{kb_used} || 0) * 1024;
 		$new->{percent_used} = ($new->{bytes_used}*100)/$new->{total_space};
-		if (my $d = $stat->{fs_perf_stat}) {
-		    $new->{commit_latency_ms} = $d->{commit_latency_ms};
-		    $new->{apply_latency_ms} = $d->{apply_latency_ms};
-		}
 	    }

+	    if (my $d = $osdperfdata->{$e->{id}}) {
+		$new->{commit_latency_ms} = $d->{commit_latency_ms};
+		$new->{apply_latency_ms} = $d->{apply_latency_ms};
+            }
+
 	    my $osdmd = $osdmetadata->{$e->{id}};
 	    if ($e->{type} eq 'osd' && $osdmd) {
 		if ($osdmd->{bluefs}) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP
URL: <http://pve.proxmox.com/pipermail/pve-devel/attachments/20170814/51c381fd/attachment.sig>


More information about the pve-devel mailing list