From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id E9CED60DFB for ; Sun, 11 Oct 2020 10:23:58 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id D54601E6EF for ; Sun, 11 Oct 2020 10:23:58 +0200 (CEST) Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id B260A1E6D8 for ; Sun, 11 Oct 2020 10:23:56 +0200 (CEST) Received: by mail-lj1-x242.google.com with SMTP id x16so441900ljh.2 for ; Sun, 11 Oct 2020 01:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=odiso-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=dYZZdi2aN/X/aMNDtCC0rEd1FejBbBHF88GA/xzl4Gc=; b=fDe6RvPF2HDcEU4OSUiSR3Uu+lT8lhywUP8p2+JFI6wJXv3tfVKl3zZBylo8la89gw iGM2bqsyPJdoTo5pLkbAqpkWAVmeAidMcrGYOF6ehFEhlJLJ6TkhaiCqN1KO2htC1BKi ryoX+hytiye2KxtptdyLNCDv+f030gZvTDRE84PR5+o67LvfZh9kEXnUiYgXmiYi578a Duh+ApVc91RHTFOPCRsqv6jXEXgNJvNBXEtmscCKCkHPp9FHIizBjEucoQONJBtCCmJy UVT10mkPf5LmKTlpA55Xf73UcYXewYEIDGP/ZGalN5hyyDrkG6XpKwBRiASTzy81WXnk vijQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=dYZZdi2aN/X/aMNDtCC0rEd1FejBbBHF88GA/xzl4Gc=; b=J5EGfxdnlLp5SljyaMq1/v187uzhAYgFFuLxrBC4LDHqv4/Gp/FptOCb6LIdKt0UP5 3toGQlMaDOUCTeC6moWiiUJtgRvA34rO20rCzB/rKEG25wF/rr6IEGSYmyRhYUzQcckH Dak/OEW4l3XdB6HUqmLovNODOSb9ufe6mUXZzgFQCFa4tpgKTu3+kl20CMuAEpPu50Zr dPn7EprVZgD7LAXILKOZNVdJCfKIuLkzhBCyQXArRq3wTesV7o7TktHTAonqzs5WS8Qf 0Rbkf5cNQIetGfUe9IYLTfLYcHaWgVnodnB7WX3y2p7FXAsN0gOu4mYuvGBTvufKWagU Rcug== X-Gm-Message-State: AOAM531xihAgM0C1WTY8MwOCdF0c2NHwBmWXX4+tHHBasWMDV34myrha JIL7+wPX2PkXa8o93Ohy27xcifDl0Qk4Hf10IVhhAxnwU8nIgPKR X-Google-Smtp-Source: ABdhPJwyw0e+nFtnk/2aF1WsVqbgEmo1k0iS4iv0g8TSMBVOOpcm5let82CVIeR53DWd2mNbR18wagQ53U/kNLM1SlQ= X-Received: by 2002:a2e:8e2a:: with SMTP id r10mr3897855ljk.344.1602404629652; Sun, 11 Oct 2020 01:23:49 -0700 (PDT) MIME-Version: 1.0 References: <20201006115839.1026402-1-aderumier@odiso.com> <20201006115839.1026402-2-aderumier@odiso.com> In-Reply-To: <20201006115839.1026402-2-aderumier@odiso.com> From: Alexandre Derumier Date: Sun, 11 Oct 2020 10:23:38 +0200 Message-ID: To: pve-devel@lists.proxmox.com X-SPAM-LEVEL: Spam detection results: 0 DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature HTML_MESSAGE 0.001 HTML included in message RCVD_IN_DNSWL_NONE -0.0001 Sender listed at https://www.dnswl.org/, no trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [procfstools.pm] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: Re: [pve-devel] [PATCH pve-common 1/1] ProcFSTools: add read_pressure X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Oct 2020 08:23:59 -0000 Hi, I have notice that it's possible to get pressure info for each vm/ct through cgroups /sys/fs/cgroup/unified/qemu.slice/.scope/cpu.pressure /sys/fs/cgroup/unified/lxc//cpu.pressure Maybe it could be great to have some new rrd graphs for each vm/ct ? They are very useful counters to known a specific vm/ct is overloaded Le mar. 6 oct. 2020 =C3=A0 13:58, Alexandre Derumier = a =C3=A9crit : > read new /proc/pressure/(cpu,disk,io) introduced in kernel 4.20. > > This give more granular informations than loadaverage. > > Signed-off-by: Alexandre Derumier > --- > src/PVE/ProcFSTools.pm | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > > diff --git a/src/PVE/ProcFSTools.pm b/src/PVE/ProcFSTools.pm > index 7cf1472..7687c13 100644 > --- a/src/PVE/ProcFSTools.pm > +++ b/src/PVE/ProcFSTools.pm > @@ -132,6 +132,24 @@ sub read_loadavg { > return wantarray ? (0, 0, 0) : 0; > } > > +sub read_pressure { > + > + my $res =3D {}; > + foreach my $type (qw(cpu memory io)) { > + if (my $fh =3D IO::File->new ("/proc/pressure/$type", "r")) { > + while (defined (my $line =3D <$fh>)) { > + if ($line =3D~ > /^(some|full)\s+avg10\=3D(\d+\.\d+)\s+avg60\=3D(\d+\.\d+)\s+avg300\=3D(\d= +\.\d+)\s+total\=3D(\d+)/) > { > + $res->{$type}->{$1}->{avg10} =3D $2; > + $res->{$type}->{$1}->{avg60} =3D $3; > + $res->{$type}->{$1}->{avg300} =3D $4; > + } > + } > + $fh->close; > + } > + } > + return $res; > +} > + > my $last_proc_stat; > > sub read_proc_stat { > -- > 2.20.1 > >