@cryptotaxi247 / netdata-1 / commits / 8182d439d

Remove NFS readahead histogram (#13819)

Vladimir Kobal committed Oct 14, 2022 at 10:21 UTC 8182d439d6c6fc8691613d26e6a7054b1254635c
1 file changed +2 -100
collectors/proc.plugin/proc_net_rpc_nfsd.c
+2 -100
@@ -225,8 +225,8 @@ struct nfsd_procs nfsd4_ops_values[] = {
225 int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
226 (void)dt;
227 static procfile *ff = NULL;
228 - static int do_rc = -1, do_fh = -1, do_io = -1, do_th = -1, do_ra = -1, do_net = -1, do_rpc = -1, do_proc2 = -1, do_proc3 = -1, do_proc4 = -1, do_proc4ops = -1;
229 - static int ra_warning = 0, proc2_warning = 0, proc3_warning = 0, proc4_warning = 0, proc4ops_warning = 0;
228 + static int do_rc = -1, do_fh = -1, do_io = -1, do_th = -1, do_net = -1, do_rpc = -1, do_proc2 = -1, do_proc3 = -1, do_proc4 = -1, do_proc4ops = -1;
229 + static int proc2_warning = 0, proc3_warning = 0, proc4_warning = 0, proc4ops_warning = 0;
230
231 if(unlikely(!ff)) {
232 char filename[FILENAME_MAX + 1];
@@ -243,7 +243,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
243 do_fh = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "file handles", 1);
244 do_io = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "I/O", 1);
245 do_th = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "threads", 1);
246 - do_ra = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "read ahead", 1);
246 do_net = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "network", 1);
247 do_rpc = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "rpc", 1);
248 do_proc2 = config_get_boolean("plugin:proc:/proc/net/rpc/nfsd", "NFS v2 procedures", 1);
@@ -258,7 +257,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
257 if(do_fh) do_fh = 1;
258 if(do_io) do_io = 1;
259 if(do_th) do_th = 1;
261 - if(do_ra) do_ra = 1;
260 if(do_net) do_net = 1;
261 if(do_rpc) do_rpc = 1;
262 if(do_proc2) do_proc2 = 1;
@@ -273,7 +271,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
271 unsigned long long fh_stale = 0;
272 unsigned long long io_read = 0, io_write = 0;
273 unsigned long long th_threads = 0;
276 - unsigned long long ra_size = 0, ra_hist10 = 0, ra_hist20 = 0, ra_hist30 = 0, ra_hist40 = 0, ra_hist50 = 0, ra_hist60 = 0, ra_hist70 = 0, ra_hist80 = 0, ra_hist90 = 0, ra_hist100 = 0, ra_none = 0;
274 unsigned long long net_count = 0, net_udp_count = 0, net_tcp_count = 0, net_tcp_connections = 0;
275 unsigned long long rpc_calls = 0, rpc_bad_format = 0, rpc_bad_auth = 0, rpc_bad_client = 0;
276
@@ -336,38 +333,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
333
334 do_th = 2;
335 }
339 - else if(do_ra == 1 && strcmp(type, "ra") == 0) {
340 - if(unlikely(words < 13)) {
341 - error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 13);
342 - continue;
343 - }
344 -
345 - // readahead cache has been disabled since 2019 (kernel 5.4)
346 - // https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/fs/nfsd/vfs.c?id=501cb1849f865960501d19d54e6a5af306f9b6fd
347 -
348 - ra_size = str2ull(procfile_lineword(ff, l, 1));
349 - ra_hist10 = str2ull(procfile_lineword(ff, l, 2));
350 - ra_hist20 = str2ull(procfile_lineword(ff, l, 3));
351 - ra_hist30 = str2ull(procfile_lineword(ff, l, 4));
352 - ra_hist40 = str2ull(procfile_lineword(ff, l, 5));
353 - ra_hist50 = str2ull(procfile_lineword(ff, l, 6));
354 - ra_hist60 = str2ull(procfile_lineword(ff, l, 7));
355 - ra_hist70 = str2ull(procfile_lineword(ff, l, 8));
356 - ra_hist80 = str2ull(procfile_lineword(ff, l, 9));
357 - ra_hist90 = str2ull(procfile_lineword(ff, l, 10));
358 - ra_hist100 = str2ull(procfile_lineword(ff, l, 11));
359 - ra_none = str2ull(procfile_lineword(ff, l, 12));
360 -
361 - unsigned long long sum = ra_hist10 + ra_hist20 + ra_hist30 + ra_hist40 + ra_hist50 + ra_hist60 + ra_hist70 + ra_hist80 + ra_hist90 + ra_hist100 + ra_none;
362 - if(sum == 0ULL) {
363 - if(!ra_warning) {
364 - info("Disabling /proc/net/rpc/nfsd read ahead histogram. It seems unused on this machine. It will be enabled automatically when found with data in it.");
365 - ra_warning = 1;
366 - }
367 - do_ra = -1;
368 - }
369 - else do_ra = 2;
370 - }
336 else if(do_net == 1 && strcmp(type, "net") == 0) {
337 if(unlikely(words < 5)) {
338 error("%s line of /proc/net/rpc/nfsd has %zu words, expected %d", type, words, 5);
@@ -617,69 +582,6 @@ int do_proc_net_rpc_nfsd(int update_every, usec_t dt) {
582
583 // --------------------------------------------------------------------
584
620 - if(do_ra == 2) {
621 - static RRDSET *st = NULL;
622 - static RRDDIM *rd_ra_hist10 = NULL,
623 - *rd_ra_hist20 = NULL,
624 - *rd_ra_hist30 = NULL,
625 - *rd_ra_hist40 = NULL,
626 - *rd_ra_hist50 = NULL,
627 - *rd_ra_hist60 = NULL,
628 - *rd_ra_hist70 = NULL,
629 - *rd_ra_hist80 = NULL,
630 - *rd_ra_hist90 = NULL,
631 - *rd_ra_hist100 = NULL,
632 - *rd_ra_none = NULL;
633 -
634 - if(unlikely(!st)) {
635 - st = rrdset_create_localhost(
636 - "nfsd"
637 - , "readahead"
638 - , NULL
639 - , "readahead"
640 - , NULL
641 - , "NFS Server Read Ahead Depth"
642 - , "percentage"
643 - , PLUGIN_PROC_NAME
644 - , PLUGIN_PROC_MODULE_NFSD_NAME
645 - , NETDATA_CHART_PRIO_NFSD_READAHEAD
646 - , update_every
647 - , RRDSET_TYPE_STACKED
648 - );
649 -
650 - rd_ra_hist10 = rrddim_add(st, "10%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
651 - rd_ra_hist20 = rrddim_add(st, "20%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
652 - rd_ra_hist30 = rrddim_add(st, "30%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
653 - rd_ra_hist40 = rrddim_add(st, "40%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
654 - rd_ra_hist50 = rrddim_add(st, "50%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
655 - rd_ra_hist60 = rrddim_add(st, "60%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
656 - rd_ra_hist70 = rrddim_add(st, "70%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
657 - rd_ra_hist80 = rrddim_add(st, "80%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
658 - rd_ra_hist90 = rrddim_add(st, "90%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
659 - rd_ra_hist100 = rrddim_add(st, "100%", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
660 - rd_ra_none = rrddim_add(st, "misses", NULL, 1, 1, RRD_ALGORITHM_PCENT_OVER_DIFF_TOTAL);
661 - }
662 - else rrdset_next(st);
663 -
664 - // ignore ra_size
665 - (void)ra_size;
666 -
667 - rrddim_set_by_pointer(st, rd_ra_hist10, ra_hist10);
668 - rrddim_set_by_pointer(st, rd_ra_hist20, ra_hist20);
669 - rrddim_set_by_pointer(st, rd_ra_hist30, ra_hist30);
670 - rrddim_set_by_pointer(st, rd_ra_hist40, ra_hist40);
671 - rrddim_set_by_pointer(st, rd_ra_hist50, ra_hist50);
672 - rrddim_set_by_pointer(st, rd_ra_hist60, ra_hist60);
673 - rrddim_set_by_pointer(st, rd_ra_hist70, ra_hist70);
674 - rrddim_set_by_pointer(st, rd_ra_hist80, ra_hist80);
675 - rrddim_set_by_pointer(st, rd_ra_hist90, ra_hist90);
676 - rrddim_set_by_pointer(st, rd_ra_hist100,ra_hist100);
677 - rrddim_set_by_pointer(st, rd_ra_none, ra_none);
678 - rrdset_done(st);
679 - }
680 -
681 - // --------------------------------------------------------------------
682 -
585 if(do_net == 2) {
586 static RRDSET *st = NULL;
587 static RRDDIM *rd_udp = NULL,