all lists on lists.proxmox.com
 help / color / mirror / Atom feed
From: "DERUMIER, Alexandre" <Alexandre.DERUMIER@groupe-cyllene.com>
To: "f.ebner@proxmox.com" <f.ebner@proxmox.com>
Cc: "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] cluster resource scheduler question
Date: Wed, 23 Nov 2022 12:18:55 +0000	[thread overview]
Message-ID: <2b56cf0d5f9f68ff6d3fc8d4c88f224b3ea1362f.camel@groupe-cyllene.com> (raw)
In-Reply-To: <cddc78c7-b6a8-e5e6-d0e9-ecb21775b80b@proxmox.com>

Ah ok, got it, thanks.

I had totally missed HA/Usage/Static.pm , which is used in
recompute_online_node_usage.


I was a bit lost between perl && rust, but I begin to understand how
it's working.  (Nice code BTW ;)




Le mercredi 23 novembre 2022 à 12:28 +0100, Fiona Ebner a écrit :
> Am 23.11.22 um 11:18 schrieb DERUMIER, Alexandre:
> > After doing some test, 
> > 
> > 
> > if I understand, the node static infos max-mem, max-cpu are only
> > used
> > to have percents to be able to compare each node.
> > 
> > and the nodeusage is compute with the sum of static mem/cpu of the
> > services running on this node.
> > 
> > But I really don't see where it's node in the rust code ?
> > 
> > 
> > I see a 
> > 
> > +impl StaticNodeUsage {
> > +    /// Add usage of `service` to the node's usage.
> > +    pub fn add_service_usage(&mut self, service:
> > &StaticServiceUsage)
> > {
> > +        self.cpu = add_cpu_usage(self.cpu, self.maxcpu as f64,
> > service.maxcpu);
> > +        self.mem += service.maxmem;
> > +    }
> > +}
> > 
> > 
> > But I don't see where it's called ?
> 
> The Perl code calls into the PVE::RS::ResourceScheduling module. That
> module acts as a FFI (generated by perlmod) for the Rust code in [0].
> That Rust code then calls into the proxmox-resource-scheduling crate.
> For example, at line 93, it calls the method you mentioned.
> 
> [0]
> https://antiphishing.cetsi.fr/proxy/v3?i=d1l4NXNNaWE4SWZqU0dLWcuTfdxEd98NfWIp9dma5kY&r=MXJUa0FrUVJqc1UwYWxNZ8tuXduEO8AMVnCPQXMJjAacdo9GABnHjKxpaZ5vEHCU6zVrUZu3S1lZhwcGmwx2yA&f=c2xMdVN4Smh2R2tOZDdIRLb87S4icH52IJimWEw_GeUm5GbjoNM9wfgv6zQHlbuo&u=https%3A//git.proxmox.com/%3Fp%3Dproxmox-perl-rs.git%3Ba%3Dblob%3Bf%3Dpve-rs/src/resource_scheduling/static.rs%3Bh%3Dc47dcd3477eb75d7c7f14c7c4d914179a549430e%3Bhb%3DHEAD&k=fjzS
> 
> 


      reply	other threads:[~2022-11-23 12:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-22 16:43 DERUMIER, Alexandre
2022-11-23  9:09 ` Fiona Ebner
2022-11-23 10:58   ` Thomas Lamprecht
2022-11-23 10:18 ` DERUMIER, Alexandre
2022-11-23 11:28   ` Fiona Ebner
2022-11-23 12:18     ` DERUMIER, Alexandre [this message]

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=2b56cf0d5f9f68ff6d3fc8d4c88f224b3ea1362f.camel@groupe-cyllene.com \
    --to=alexandre.derumier@groupe-cyllene.com \
    --cc=f.ebner@proxmox.com \
    --cc=pve-devel@lists.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal