Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

benchmark time period #181

Open
gperciva opened this issue Aug 10, 2020 · 10 comments
Open

benchmark time period #181

gperciva opened this issue Aug 10, 2020 · 10 comments

Comments

@gperciva
Copy link
Member

Do you have a particular intuition behind taking a particular time range (such as 50 to 60 seconds for bulk_update)?

In the attached pngs, it looks like the number of operations per second in bulk_update are randomly distributed. Here's 3 tests (I cancelled the last one a little bit early).

I'd be tempted to use the median, or the 25% & 75% quadrants, rather than the mean of a specific time range.
(As it happens, I spent the past 2 days working on perftests for spiped, so I have this in my mind.)

bulk1
bulk2
bulk3

@gperciva
Copy link
Member Author

BTW, those benchmarks were done on my freebsd desktop. Would it be helpful if I used some standard EC2 hardware, like C6g.medium or c5.large?

@cperciva
Copy link
Member

My concern with benchmarks is "warming up" -- you can see in those graphs that the performance in the first second is higher than later, presumably because data structures are clean and kvlds isn't being slowed down by needing to evict pages from memory. How long this warmup period takes will depend on the benchmark, so I went with a conservative value.

I'm not expecting to run these benchmarks very often -- they exist mainly for comparing between versions -- so I'm not too concerned about them taking a while to run.

@cperciva
Copy link
Member

And yes, for comparison purposes these need to run on standard hardware. But no rush right now.

@gperciva
Copy link
Member Author

Sure, but the means of 50 to 60 are quite far in the first two examples:

$ awk '{if ((NR >= 50) && (NR < 60)) sum+=$0} END {print sum/10}' foo.txt 
266913
$ awk '{if ((NR >= 50) && (NR < 60)) sum+=$0} END {print sum/10}' bar.txt 
322541

whereas the medians of 10 to 60 are closer (although admittedly not as close as I was expecting).

$ awk '{if ((NR >= 10) && (NR < 60)) a[i++] = $1} END {print a[int(i/2)]}' foo.txt 
294197
$ awk '{if ((NR >= 10) && (NR < 60)) a[i++] = $1} END {print a[int(i/2)]}' bar.txt 
335462

@cperciva
Copy link
Member

Did you forget a sort when calculating the medians?

@gperciva
Copy link
Member Author

Oops. Yeah, that gives much more similar values. Invoking a useless cat since it adds clarity:

$ cat foo.txt | awk '{if ((NR >= 10) && (NR < 60)) print $1}' | sort | awk '{a[i++]=$1} END {print a[int(i/2)]}'
324656
$ cat bar.txt | awk '{if ((NR >= 10) && (NR < 60)) print $1}' | sort | awk '{a[i++]=$1} END {print a[int(i/2)]}'
329101

@gperciva
Copy link
Member Author

BTW, c5.large produces the same type of timing data:

c5

@cperciva
Copy link
Member

Sounds good to me.

BTW the low performance on c5.large is because reading the clock is ridiculously slow. Or rather, it is with the default settings -- adjusting the timecounter used on FreeBSD speeds things up dramatically. I need to dig into that at some point.

@gperciva
Copy link
Member Author

Do you mean "the default clock method used by monoclock.c is slow on c5.large", or do you mean "there's something in the kernel that's sub-optimal"?

FWIW, c6g.large has three times the operations with bulk_update.

c6g

@cperciva
Copy link
Member

The FreeBSD kernel has a setting which tells is where to get the time from, and the default is suboptimal, at least for x86.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants