On 9/23/24 14:00, Friedrich Weber wrote:
On 23/09/2024 11:17, Dominik Csapak wrote:
[...]
so i did some benchmarks (mostly disk writes) and wrote the short script
below
(maybe we can reuse that?)

----8<----
use strict;
use warnings;

use PVE::Tools;

my $size = shift;

sub get_bytes_written {
         my $fh = IO::File->new("/proc/diskstats", "r");
         die if !$fh;
         my $bytes = undef;
         while (defined(my $line = <$fh>)) {
                 if ($line =~ m/sdb/) {
                         my @fields = split(/\s+/, $line);
                         $bytes = $fields[10] * 512;
                 }
         }
         return $bytes;
}

sub test_write {
         my ($k) = @_;
         system("rm /etc/pve/testfile");
         my $data = "a"x($k*1024);
         system("sync; echo -n 3> /proc/sys/vm/drop_caches");

I'm not sure this actually drops the caches: Without the space between
`3` and `>` I think this redirects fd 3 to that file (so doesn't
actually write the `3`)? I didn't run the script though, so not sure if
it makes any difference for the results.

ah yeah, i noticed, but forgot to answer here. i fixed it here locally and
rerun the tests but had the same results (+- a bit of variation)


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

Reply via email to