Skip to content

Introduce latency buckets for S3#69783

Merged
alexkats merged 8 commits intoClickHouse:masterfrom
alexkats:s3-metrics
Feb 6, 2025
Merged

Introduce latency buckets for S3#69783
alexkats merged 8 commits intoClickHouse:masterfrom
alexkats:s3-metrics

Conversation

@alexkats
Copy link
Copy Markdown
Contributor

@alexkats alexkats commented Sep 19, 2024

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Introduce latency buckets and use them to track first byte read/write and connect times for S3 requests. That way we can later use gathered data to calculate approximate percentiles and adapt timeouts.

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)
CI

Information about CI checks: https://clickhouse.com/docs/en/development/continuous-integration/

CI Settings (Only check the boxes if you know what you are doing):

  • Allow: All Required Checks
  • Allow: Stateless tests
  • Allow: Stateful tests
  • Allow: Integration Tests
  • Allow: Performance tests
  • Allow: All Builds
  • Allow: batch 1, 2 for multi-batch jobs
  • Allow: batch 3, 4, 5, 6 for multi-batch jobs

  • Exclude: Style check
  • Exclude: Fast test
  • Exclude: All with ASAN
  • Exclude: All with TSAN, MSAN, UBSAN, Coverage
  • Exclude: All with aarch64, release, debug

  • Run only fuzzers related jobs (libFuzzer fuzzers, AST fuzzers, etc.)
  • Exclude: AST fuzzers

  • Do not test
  • Woolen Wolfdog
  • Upload binaries for special builds
  • Disable merge-commit
  • Disable CI cache

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-improvement Pull request with some product improvements label Sep 19, 2024
@alexkats
Copy link
Copy Markdown
Contributor Author

alexkats commented Sep 19, 2024

This is the first iteration to improve the situation with S3 timeouts. I'm not sure about the naming tbh. Also, I should probably use column compression for latency_log. So I'm open to suggestions.

I split the changes into 3 commits, hopefully it's easier to review this way

@robot-ch-test-poll1
Copy link
Copy Markdown
Contributor

robot-ch-test-poll1 commented Sep 19, 2024

This is an automated comment for commit 21f43dd with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (asan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (debug)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (msan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (tsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
BuzzHouse (ubsan)There's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns ClickBench with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

@alexkats alexkats changed the title Introduce latency buckets for S3 [WIP] Introduce latency buckets for S3 Sep 19, 2024
@alexkats alexkats force-pushed the s3-metrics branch 4 times, most recently from 1ab412a to f4b60d4 Compare September 21, 2024 09:11
@CheSema
Copy link
Copy Markdown
Member

CheSema commented Oct 2, 2024

I have a question.
I see virtual ConnectionPtr IHTTPConnectionPoolForEndpoint::getConnection(const ConnectionTimeouts & timeouts, UInt64 * connect_time) method. It notifys you with connect_time. But in fact the could be no any connection event at all.
How does it count in a result? As connection with time 0 or as if nothing had happened?

Comment thread src/Common/LatencyBuckets.cpp Outdated
Comment thread src/IO/S3/PocoHTTPClient.cpp Outdated
Comment thread src/IO/S3/PocoHTTPClient.cpp Outdated
Comment thread src/IO/S3/PocoHTTPClient.cpp Outdated
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Nov 5, 2024

Dear @tavplubix, @CheSema, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@CheSema CheSema self-assigned this Nov 6, 2024
@clickhouse-gh
Copy link
Copy Markdown
Contributor

clickhouse-gh Bot commented Dec 10, 2024

Dear @CheSema, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@alexkats alexkats changed the title [WIP] Introduce latency buckets for S3 Introduce latency buckets for S3 Jan 20, 2025
@alexkats
Copy link
Copy Markdown
Contributor Author

I have a question. I see virtual ConnectionPtr IHTTPConnectionPoolForEndpoint::getConnection(const ConnectionTimeouts & timeouts, UInt64 * connect_time) method. It notifys you with connect_time. But in fact the could be no any connection event at all. How does it count in a result? As connection with time 0 or as if nothing had happened?

There's a check in the addLatency for the time being 0, and if it is, we won't process it for the latency log

@alexkats alexkats force-pushed the s3-metrics branch 2 times, most recently from 66cd32c to bd5e2b7 Compare January 23, 2025 20:39
Comment thread src/IO/S3/PocoHTTPClient.cpp Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just curios. Do you know how to find this logs after a fail?
I do not know.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There's a pytest.log in tests/integration directory when you run the test

Copy link
Copy Markdown
Member

@CheSema CheSema left a comment

Choose a reason for hiding this comment

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

I general I just happy with it.

Comment thread src/Common/LatencyBuckets.cpp Outdated
Alex Katsman added 8 commits February 5, 2025 16:36
Use latency buckets to track first byte read/write and connect
times for S3 requests. That way we can later use gathered data
to calculate approximate percentiles and adapt timeouts.
@alexkats alexkats added this pull request to the merge queue Feb 6, 2025
Merged via the queue into ClickHouse:master with commit 73b3b3a Feb 6, 2025
@alexkats alexkats deleted the s3-metrics branch February 6, 2025 01:34
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Feb 6, 2025
@alexkats alexkats mentioned this pull request Feb 19, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-improvement Pull request with some product improvements pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants