Re: Load testing with mc-crusher

2020-05-01 Thread dormando
Hey,

I didn't try your script but it's not quite clear how it's gathering
statistics. just once at each end of the test?

I'd left some test suites from my blog posts in the test-suites/ directory
of mc-crusher, but they weren't very clean or easy to modify...

Found another one I'd done later with a refactoring that's a lot better:
https://github.com/memcached/mc-crusher/blob/master/test-suites/test-suite-example

just cleaned up some bits and wrote a few notes into it. I don't have the
if tooling I was using to process the data into json blobs (maybe I'll add
it you want it :P)

There are a bunch of parameters to tune, or tests you can outright delete.
Any mc-crusher configuration file can be represented in there (see the
"get_*_conf" subs).

This will grab a bunch of data _while_ the perf test runs, which you can
then plot or examine for consistency. It also runs a scaled set of tests,
so you can find the performance cliffs. I don't believe any benchmark is
valid unless you find the test to failure point and show what latency
looks like on your way there.

So this will run a bunch of tests and scale up the mc-crusher config. You
get:

- stats sample output (see sample_args()). You get the rate every N
seconds for X periods, and at the end it'll have an average from the full
run. You can look into this for spikes/dips/consistency.

- the stats sampling starts _after_ the benchmark starts, so you don't end
up weighting ramp up time into the average.

- latency sampled output (along with some summary information). You can
examine these files to see when the benchmark throughput has exceeded your
latency budget.

- Some other crap I probably forget.

Anyway this is how I test stuff for those blog posts with all the graphs.
You mostly tweak it a bit and ignore it for a while, then tweak and try
again.

On Wed, 8 Apr 2020, Martin Grigorov wrote:

> Hi,
>
> Does it make sense to have a command 'flush_stats' ?
> 'flush_all' resets the caches but the stats stay, e.g. cmd_get value is not 
> reset.
>
> I'd find it useful for performance measurements:
> 1) run random warm-up
> 2) reset_stats
> 3) run perf test
> 4) collect stats
>
> Right now I do:
> 1) run random warm-up
> 2) collect stats
> 3) run perf test
> 4) collect stats
> 5) substract 2) from 4) and store the result
>
> Regards,
> Martin
>
> On Tue, Apr 7, 2020 at 3:29 PM Martin Grigorov  
> wrote:
>   Hi Dormando,
>
>   This is a continuation of the mail thread with subject "Is ARM64 
> officially supported ?" [1]
>
> I've refreshed my Perl coding skills and came up with this wrapper around 
> mc-crusher:
>
> =
> #!/usr/bin/env perl
>
> # sudo cpan Cache::Memcached
>
> use strict;
> use warnings;
>
> use Cache::Memcached;
> use Data::Dumper;
> use Time::Piece;
>
> my $TESTBED_HOME = $ENV{'TESTBED_HOME'};
> die "Env variable 'TESTBED_HOME' is not set!" if ! defined($TESTBED_HOME);
> my $MC_CRUSHER_HOME = $ENV{'MC_CRUSHER_HOME'};
> die "Env variable 'MC_CRUSHER_HOME' is not set!" if ! 
> defined($MC_CRUSHER_HOME);
>
> if (scalar(@ARGV) < 2) {
>         die "Usage: mc-crusher.pl. For 
> example: mc-crusher.pl cmd_get a.b.c.d 11211 60"
> }
>
> my $config = shift @ARGV;
> my $host = shift @ARGV;
> my $port = shift @ARGV || 8080;
> my $duration = shift @ARGV || 5 * 60; # 5 mins
>
> system("$MC_CRUSHER_HOME/mc-crusher --conf 
> $TESTBED_HOME/etc/memcached/mc-crusher/conf/$config.conf --ip $host --port 
> $port --timeout $duration");
>
> print "MC Crusher status: $!\n" if $!;
>
> my $serverAddr = "$host:$port";
> print "Server: $serverAddr\n";
> my @servers = ($serverAddr);
>
> my $memcached = new Cache::Memcached;
> $memcached->set_servers(\@servers);
>
> my $stats = $memcached->stats(['misc'])->{'hosts'}->{$serverAddr}->{'misc'};
> warn Dumper($stats);
>
> my $timestamp = localtime->datetime();
> my $cmd_per_sec = int($stats->{$config}) / $duration;
> my $bytes_written = $stats->{'bytes_written'};
> my $bytes_read = $stats->{'bytes_read'};
> my $time_system = $stats->{'rusage_system'};
> my $time_user = $stats->{'rusage_user'};
>
> my $today = localtime->ymd();
> my $folder = "$TESTBED_HOME/etc/memcached/$today";
> system("mkdir -p $folder");
> print "Cannot create '$folder': $!\n" if $!;
> my $filename = "$folder/memcached-mc-crusher-report-$host-$config.csv";
>
> my $headerPrefix = "${host}_${config}";
> open(my $fh, '>', $filename) or die "Could not open file '$filename': $!";
> print $fh 
> "timeStamp,${headerPrefix}_per_sec,${headerPrefix}_bytes_written,${headerPrefix}_bytes_read,"
>  .
>     "${headerPrefix}_time_system,${headerPrefix}_time_user,config,host\n";
> print $fh 
> "$timestamp,$cmd_per_sec,$bytes_written,$bytes_read,$time_system,$time_user,$config,$host\n";
> close $fh;
> print "done\n";
> ==
>
> Basically it executes mc-crusher with different configurations against 
> different servers (x64 vs arm64) and stores the stats in CSV files, which
> l

Re: Is ARM64 officially supported ?

2020-05-01 Thread dormando
Hey,

Sorry I missed this (almost two months ago?)

If I were to do a serious performance comparison for ARM right now it
would have to be a sponsored project; I can't justify the time out of
personal curiosity right now :)

If you want some detailed analysis contact me privately and we can
discuss.

-Dormando

On Mon, 9 Mar 2020, Martin Grigorov wrote:

> Hi Dormando,
>
> On Mon, Mar 9, 2020 at 9:19 AM Martin Grigorov  
> wrote:
>   Hi Dormando,
>
> On Fri, Mar 6, 2020 at 10:15 PM dormando  wrote:
>   Yo,
>
>   Just to add in: yes we support ARM64. Though my build test platform is a
>   raspberry pi 3 and I haven't done any serious performance work. 
> packet.net
>   had an arm test platform program but I wasn't able to get time to do any
>   work.
>
>   From what I hear it does seem to perform fine on high end ARM64 
> platforms,
>   I just can't do any specific perf work unless someone donates hardware.
>
>
> I will talk with my managers!
> I think it should not be a problem to give you a SSH access to one of our 
> machines.
> What specs do you prefer ? CPU, disks, RAM, network, ...
> VM or bare metal ? 
> Preferred Linux flavor ?
>
> It would be good to compare it against whatever AMD64 instance you have. Or I 
> can also ask for two similar VMs - ARM64 and AMD64.
>
>
> My manager confirmed that we can give you access to an ARM64 machine. VM 
> would be easier to setup but bare metal is also possible.
> Please tell me the specs you prefer.
> We can give you access only temporarily though, i.e. we will have to shut it 
> down after you finish the testing, so it doesn't stay idle and waste budget.
> Later if you need it we can allocate it again.
> Would this work for you ?
>
> Martin 
>  
>
>
> Martin
>  
>
>   -Dormando
>
>   On Fri, 6 Mar 2020, Martin Grigorov wrote:
>
>   > Hi Emilio,
>   >
>   > On Fri, Mar 6, 2020 at 9:14 AM Emilio Fernandes 
>  wrote:
>   >       Thank you for sharing your experience, Martin!
>   > I've played for few days with Memcached on our ARM64 test servers and 
> so far I also didn't face any issues.
>   >
>   > Do you know of any performance benchmarks of Memcached on AMD64 and 
> ARM64 ? Or at least of a performance test suite that I can run
>   myself ?
>   >
>   >
>   > I am not aware of any public benchmark results for Memcached on AMD64 
> vs ARM64.
>   > But quick search in Google returned these promising results:
>   > 1) https://github.com/memcached/mc-crusher
>   > 2) https://github.com/scylladb/seastar/wiki/Memcached-Benchmark
>   > 3) https://github.com/RedisLabs/memtier_benchmark
>   > 4) http://www.lmdb.tech/bench/memcache/
>   >  
>   > I will try some of them next week and report back!
>   >
>   > Martin
>   >
>   >
>   > Gracias!
>   > Emilio
>   >
>   > сряда, 4 март 2020 г., 16:30:37 UTC+2, Martin Grigorov написа:
>   >       Hello Emilio!
>   > Welcome to this community!
>   >
>   > I am a regular user of Memcached and I can say that it works just 
> fine for us on ARM64!
>   > We are still at early testing stage but so far so good!
>   >
>   > I like the idea to have this mentioned on the website!
>   > It will bring confidence to more users!
>   >
>   > Regards,
>   > Martin
>   >
>   > On Wed, Mar 4, 2020 at 4:09 PM Emilio Fernandes 
>  wrote:
>   >       Hello Memcached community!
>   > I'd like to know whether ARM64 architecture is officially supported ?
>   > I've seen that Memcached is being tested on ARM64 at Travis but I do 
> not see anything on the website or in GitHub Wiki explicitly
>   saying
>   > whether it is officially supported or not.
>   >
>   > Gracias!
>   > Emilio
>   >
>   > --
>   >
>   > ---
>   > You received this message because you are subscribed to the Google 
> Groups "memcached" group.
>   > To unsubscribe from this group and stop receiving emails from it, 
> send an email to memc...@googlegroups.com.
>   > To view this discussion on the web visit
>   > 
> https://groups.google.com/d/msgid/memcached/bb39d899-643b-4901-8188-a11138c37b82%40googlegroups.com.
>   >
>   > --
>   >
>   > ---
>   > You received this message because you are subscribed to the Google 
> Groups "memcached" group.
>   > To unsubscribe from this group and stop receiving emails from it, 
> send an email to memcached+unsubscr...@googlegroups.com.
>   > To view this discussion on the web visit
>   
> https://groups.google.com/d/msgid/memcached/568921e6-0e29-4830-94be-355d1dbdab26%40googlegroups.com.
>   >
>   > --
>   >
>   > ---
>   > You received this message because you are subscribed to the Google 
> Groups "memcached" group.
>   > To unsubscribe from this group and stop receiving emails from it, 
> send an email to memcached+unsubscr...@go