public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Fiona Ebner <f.ebner@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH qemu-server] fix #6207: vm status: cache last disk read/write values
Date: Thu, 25 Sep 2025 10:27:46 +0200	[thread overview]
Message-ID: <9facf42e-748f-4427-ab8d-eb133d55425b@proxmox.com> (raw)
In-Reply-To: <cb87769c-83dc-481a-a1ea-33add5087008@proxmox.com>

Am 22.09.25 um 7:26 PM schrieb Thomas Lamprecht:
> Am 22.09.25 um 12:18 schrieb Fiona Ebner:
>> If disk read/write cannot be queried because of QMP timeout, they
>> should not be reported as 0, but the last value should be re-used.
>> Otherwise, the difference between that reported 0 and the next value,
>> when the stats are queried successfully, will show up as a huge spike
>> in the RRD graphs.
> 
> Fine with the idea in general, but this is effectively relevant for
> the pvestatd only though?
> 
> As of now we would also cache in the API daemon, without every using
> this. Might not be _that_ much, so not really a problem of the amount,
> but feels a bit wrong to me w.r.t. "code place".
> 
> Has pvestatd the necessary info, directly on indirectly through the
> existence of some other vmstatus properties, to derive when it can
> safely reuse the previous value?

It's safe (and sensible/required) if and only if there is no new value.
We could have the cache be only inside pvestatd, initialize the cache
with a value of 0 and properly report diskread/write values as undef if
we cannot get an actual value, and have that mean "re-use previous
value". (Aside: we cannot use 0 instead of undef to mean "re-use
previous value", because there are edge cases where a later 0 actually
means 0 again, for example, all disk unplugged).

> Or maybe we could make this caching opt-in through some module flag
> that only pvestatd sets? But not really thought that through, so
> please take this with a grain of salt.
> 
> btw. what about QMP being "stuck" for a prolonged time, should we
> stop using the previous value after a few times (or duration)? 

What other value could we use? Since the graph looks at the differences
of reported values, the only reasonable value we can use if we cannot
get a new one is the previous one. No matter how long it takes to get a
new one, or there will be that completely wrong spike again. Or is there
a N/A kind of value that we could use, where RRD/graph would be smart
enough to know "I cannot calculate a difference now, will have to wait
for multiple good values"? Then I'd go for that instead of the current
approach.


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


  reply	other threads:[~2025-09-25  8:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22 10:15 Fiona Ebner
2025-09-22 17:26 ` Thomas Lamprecht
2025-09-25  8:27   ` Fiona Ebner [this message]
2025-09-25  8:52     ` Thomas Lamprecht
2025-09-25  9:28       ` Fiona Ebner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9facf42e-748f-4427-ab8d-eb133d55425b@proxmox.com \
    --to=f.ebner@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal