From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dietmar@proxmox.com>
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))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id B0260611E6
 for <pve-devel@lists.proxmox.com>; Tue, 13 Oct 2020 09:38:29 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id A53D3BAEA
 for <pve-devel@lists.proxmox.com>; Tue, 13 Oct 2020 09:38:29 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [212.186.127.180])
 (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 firstgate.proxmox.com (Proxmox) with ESMTPS id 62A15BADD
 for <pve-devel@lists.proxmox.com>; Tue, 13 Oct 2020 09:38:28 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 31DD845D2B;
 Tue, 13 Oct 2020 09:38:28 +0200 (CEST)
Date: Tue, 13 Oct 2020 09:38:14 +0200 (CEST)
From: Dietmar Maurer <dietmar@proxmox.com>
To: Alexandre Derumier <aderumier@odiso.com>
Cc: Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Message-ID: <786323871.4.1602574695068@webmail.proxmox.com>
In-Reply-To: <CAMGxVzBo940=kdAHLxWgY6RkuFYnHxwP-pEexs_rw8zSegogLA@mail.gmail.com>
References: <20201006115839.1026402-1-aderumier@odiso.com>
 <20201006115839.1026402-2-aderumier@odiso.com>
 <CAMGxVzCCQusf3ZkfxV0=CGGoZRJhfwyhtB40zgyq6T+PSjXdRQ@mail.gmail.com>
 <190420382.634.1602569100580@webmail.proxmox.com>
 <CAMGxVzBo940=kdAHLxWgY6RkuFYnHxwP-pEexs_rw8zSegogLA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Priority: 3
Importance: Normal
X-Mailer: Open-Xchange Mailer v7.10.4-Rev10
X-Originating-Client: open-xchange-appsuite
X-SPAM-LEVEL: Spam detection results:  0
 AWL 0.070 Adjusted score from AWL reputation of From: address
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 RCVD_IN_DNSWL_MED        -2.3 Sender listed at https://www.dnswl.org/,
 medium trust
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
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 <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Tue, 13 Oct 2020 07:38:29 -0000

> BTW, I'm currently=C2=A0playing with reading the rrd files, and I have no=
tice than lower precision is 1minute.
> as pvestatd send values around each 10s, is this 1minute precision an ave=
rage of 6x10s values send by pvestatd ?

Yes (we also store the MAX)

> I'm currently working on a poc of vm balancing, but I would like to have =
something like 15min of 10s precision (90 samples of 10s).

Why do you need 10s resulution? Isn't 1min good enough?

> So currently I'm getting stats each 10s manually with=C2=A0PVE::API2Tools=
::extract_vm_stats like the ressource api.
> (This use PVE::Cluster::rrd_dump , but I don't understand the ipcc_. code=
. does it only return current streamed values?
> then after the rrdcached daemon is writing to rrd file the average values=
 each minute ?)
>=20
> I don't known if we could have rrd files with 15min of 10s precision ? (d=
on't known the write load impact on disks)

We use the following RRD conf, step is 60 seconds (see pve-cluster/src/stat=
us.c):

static const char *rrd_def_node[] =3D {
=09"DS:loadavg:GAUGE:120:0:U",
=09"DS:maxcpu:GAUGE:120:0:U",
=09"DS:cpu:GAUGE:120:0:U",
=09"DS:iowait:GAUGE:120:0:U",
=09"DS:memtotal:GAUGE:120:0:U",
=09"DS:memused:GAUGE:120:0:U",
=09"DS:swaptotal:GAUGE:120:0:U",
=09"DS:swapused:GAUGE:120:0:U",
=09"DS:roottotal:GAUGE:120:0:U",
=09"DS:rootused:GAUGE:120:0:U",
=09"DS:netin:DERIVE:120:0:U",
=09"DS:netout:DERIVE:120:0:U",

=09"RRA:AVERAGE:0.5:1:70", // 1 min avg - one hour
=09"RRA:AVERAGE:0.5:30:70", // 30 min avg - one day
=09"RRA:AVERAGE:0.5:180:70", // 3 hour avg - one week
=09"RRA:AVERAGE:0.5:720:70", // 12 hour avg - one month
=09"RRA:AVERAGE:0.5:10080:70", // 7 day avg - ony year

=09"RRA:MAX:0.5:1:70", // 1 min max - one hour
=09"RRA:MAX:0.5:30:70", // 30 min max - one day
=09"RRA:MAX:0.5:180:70",  // 3 hour max - one week
=09"RRA:MAX:0.5:720:70", // 12 hour max - one month
=09"RRA:MAX:0.5:10080:70", // 7 day max - ony year
=09NULL,
};

Also See: man rrdcreate

So no, you do not get 10s precission from RRD.