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

Benchmarking Cache and WorkerPool implementations #7

Closed
wants to merge 15 commits into from

Conversation

thrawn01
Copy link
Collaborator

@thrawn01 thrawn01 commented Mar 29, 2024

Purpose

Trying to diagnose some performance issues we notice in production during high request volume. The theory is that we are running into mutex contention. As a result we wrote WorkerPool to partition the internal cache to reduce contention. However, we never benchmarked contention. This PR is intended to add benchmarking and compare different implementations of WorkerPool.

Implementation

  • Added WorkerMutex which is just an LRU cache with a mutex around it
  • Added WorkerNoCache which is like WorkerMutex but the cache doesn't actually do anything. It's intended to be a base line to compare the other implementations with.
  • Added WorkerOtter which uses an high performance golang cache called https://maypok86.github.io/otter/
  • Added AccessStructure tests to figure out how to graph the results.
  • Added lockfree to implement a lock free version of the cache based on some papers I found. I haven't finished it as I got distracted by strange benchmark results. 😄

I created a golang application to graph the results of the benchmark.
https://github.com/gubernator-io/gubernator-graphs

See benchmark_plot.html in the graphs repo for the latest results.

Status

I think I need to run these benchmarks on a machine with more than 10 Cores (My Laptop). I'll work on doing that this weekend or next week sometime in the future.

@thrawn01 thrawn01 requested a review from Baliedge as a code owner March 29, 2024 20:40
@thrawn01 thrawn01 marked this pull request as draft March 29, 2024 20:40
@thrawn01
Copy link
Collaborator Author

thrawn01 commented May 9, 2024

Benchmark running on a 32 core machine.
Otter Performance Benchmark on 32 core machine

@thrawn01
Copy link
Collaborator Author

The result of this work has been rolled into #15

@thrawn01 thrawn01 closed this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant