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

KeyValueStoreRocksDB histograms to track latencies #6149

Merged
merged 1 commit into from
Dec 22, 2021

Conversation

neethuhaneesha
Copy link
Contributor

@neethuhaneesha neethuhaneesha commented Dec 15, 2021

KeyValueStoreRocksDB histograms to track latencies

Code-Reviewer Section

The general guidelines can be found here.

Please check each of the following things and check all boxes before accepting a PR.

  • The PR has a description, explaining both the problem and the solution.
  • The description mentions which forms of testing were done and the testing seems reasonable.
  • Every function/class/actor that was touched is reasonably well documented.

For Release-Branches

If this PR is made against a release-branch, please also check the following:

  • This change/bugfix is a cherry-pick from the next younger branch (younger release-branch or master if this is the youngest branch)
  • There is a good reason why this PR needs to go into a release branch and this reason is documented (either in the description above or in a linked GitHub issue)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: b940f21
  • Result: FAILED
  • Error: Error while executing command: if python3 -m joshua.joshua list --stopped | grep ${ENSEMBLE_ID} | grep -q 'pass=10[0-9][0-9][0-9]'; then echo PASS; else echo FAIL && exit 1; fi. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: eb1d115
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: deabed2
  • Result: FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: deabed2
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@neethuhaneesha neethuhaneesha force-pushed the rocksdbHistograms branch 2 times, most recently from e85896e to eec774b Compare December 15, 2021 18:34
@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: eec774b
  • Result: FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: e85896e
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: e85896e
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: c30bd4e
  • Result: FAILED
  • Error: Error while executing command: ninja -v -C build_output -j ${NPROC} all packages strip_targets. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: c30bd4e
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: c30bd4e
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: 6328caa
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@neethuhaneesha neethuhaneesha marked this pull request as ready for review December 18, 2021 00:02
@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: 6328caa
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

rocksdb::PinnableSlice value;
auto options = getReadOptions();
uint64_t deadlineMircos =
db->GetEnv()->NowMicros() + (readValueTimeout - (timer_monotonic() - a.startTime)) * 1000000;
uint64_t deadlineMircos = db->GetEnv()->NowMicros() + (readValueTimeout - (now() - a.startTime)) * 1000000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why changing to now()?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor Author

@neethuhaneesha neethuhaneesha Dec 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finally I have decided to use timer_monotonic for measuring the histograms.
Simulation: timer_monotonic is calling timer() which is 0.1 seconds ahead of now(). Might not show exact latencies, but it should be fine since simulation test are not used for perf measurements.
Non-simulation: timer_monotonic() returns a high precision monotonic clock. Will show exact latencies and expensive, so currently sampling with a knob at the rate of 1 out of 1000 read ops.
Sampling is not perfect but I could not find a better way.

@neethuhaneesha neethuhaneesha marked this pull request as draft December 20, 2021 19:14
fdbserver/KeyValueStoreRocksDB.actor.cpp Show resolved Hide resolved
rocksdb::PinnableSlice value;
auto options = getReadOptions();
uint64_t deadlineMircos =
db->GetEnv()->NowMicros() + (readValueTimeout - (timer_monotonic() - a.startTime)) * 1000000;
uint64_t deadlineMircos = db->GetEnv()->NowMicros() + (readValueTimeout - (now() - a.startTime)) * 1000000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

auto s = db->Get(options, db->DefaultColumnFamily(), toSlice(a.key), &value);
readValueGetHistogram->sampleSeconds(now() - dbGetBeginTime);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to move this to the below if(s.ok()) scope, to calculate only the successful reads?

@neethuhaneesha neethuhaneesha marked this pull request as ready for review December 21, 2021 21:37
@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: 995bf25
  • Result: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: 995bf25
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@neethuhaneesha neethuhaneesha marked this pull request as draft December 21, 2021 22:48
@neethuhaneesha neethuhaneesha marked this pull request as ready for review December 21, 2021 23:15
@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: dc8ba37
  • Result: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: dc8ba37
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

fdbclient/ServerKnobs.h Show resolved Hide resolved
@@ -354,6 +354,7 @@ void ServerKnobs::initialize(Randomize randomize, ClientKnobs* clientKnobs, IsSi
init( ROCKSDB_READ_QUEUE_SOFT_MAX, 500 );
init( ROCKSDB_FETCH_QUEUE_HARD_MAX, 100 );
init( ROCKSDB_FETCH_QUEUE_SOFT_MAX, 50 );
init( ROCKSDB_HISTOGRAMS_SAMPLE_RATE, 0.001 );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUGGIFY the knob to -1 to cover the code path when this histogram is disabled.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@xumengpanda
Copy link
Contributor

What's the sim test result after resolving the comments?

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for macOS Catalina 10.15

  • CodeBuild project: foundationdb-pr-macos
  • Commit ID: 1f30368
  • Result: FAILED
  • Error: Error while executing command: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ${HOME}/.ssh_key ec2-user@${MAC_EC2_HOST} /usr/local/bin/bash --login -c ./build_pr_macos.sh. Reason: exit status 1
  • Build Logs (available for 30 days)

@foundationdb-ci
Copy link
Contributor

AWS CodeBuild CI Report for Linux CentOS 7

  • CodeBuild project: foundationdb-pr
  • Commit ID: 1f30368
  • Result: SUCCEEDED
  • Error: N/A
  • Build Logs (available for 30 days)

@neethuhaneesha
Copy link
Contributor Author

What's the sim test result after resolving the comments?

20211222-071327-neethuhaneeshabingi-e8449ab7ef9f700e ended=100000 fail=4

@neethuhaneesha neethuhaneesha merged commit 3086941 into apple:master Dec 22, 2021
@neethuhaneesha neethuhaneesha deleted the rocksdbHistograms branch December 22, 2021 19:33
neethuhaneesha added a commit to neethuhaneesha/foundationdb that referenced this pull request Dec 22, 2021
KeyValueStoreRocksDB histograms to track latencies
xumengpanda pushed a commit that referenced this pull request Dec 22, 2021
KeyValueStoreRocksDB histograms to track latencies
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.

4 participants