Skip to content

[WIP]Test orc prefetch#29

Closed
taiyang-li wants to merge 1 commit intotest_prefetchfrom
test_orc_prefetch
Closed

[WIP]Test orc prefetch#29
taiyang-li wants to merge 1 commit intotest_prefetchfrom
test_orc_prefetch

Conversation

@taiyang-li
Copy link
Copy Markdown
Collaborator

Changelog category (leave one):

  • New Feature
  • Experimental Feature
  • Improvement
  • Performance Improvement
  • Backward Incompatible Change
  • Build/Testing/Packaging Improvement
  • Documentation (changelog entry is not required)
  • Critical Bug Fix (crash, LOGICAL_ERROR, data loss, RBAC)
  • Bug Fix (user-visible misbehavior in an official stable release)
  • CI Fix or Improvement (changelog entry is not required)
  • Not for changelog (changelog entry is not required)

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

...

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

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

@taiyang-li
Copy link
Copy Markdown
Collaborator Author

taiyang-li commented Sep 26, 2024

with prefetch

select rip, rtime, country, os, event from hdfs('hdfs://bigocluster/user/hive/warehouse/test.orc') settings max_threads = 1, max_parsing_threads = 1, remote_filesystem_read_prefetch = 1, remote_read_min_bytes_for_seek = 524288 format Null; 
0 rows in set. Elapsed: 8.950 sec. Processed 780.68 thousand rows, 716.07 MB (87.23 thousand rows/s., 80.01 MB/s.)
0 rows in set. Elapsed: 5.397 sec. Processed 780.68 thousand rows, 716.07 MB (144.64 thousand rows/s., 132.67 MB/s.)
0 rows in set. Elapsed: 7.356 sec. Processed 780.68 thousand rows, 716.07 MB (106.13 thousand rows/s., 97.34 MB/s.)
0 rows in set. Elapsed: 5.735 sec. Processed 780.68 thousand rows, 716.07 MB (136.12 thousand rows/s., 124.86 MB/s.)
0 rows in set. Elapsed: 5.401 sec. Processed 780.68 thousand rows, 716.07 MB (144.54 thousand rows/s., 132.58 MB/s.)
0 rows in set. Elapsed: 5.010 sec. Processed 780.68 thousand rows, 716.07 MB (155.82 thousand rows/s., 142.93 MB/s.)
0 rows in set. Elapsed: 4.955 sec. Processed 780.68 thousand rows, 716.07 MB (157.55 thousand rows/s., 144.52 MB/s.)
0 rows in set. Elapsed: 5.907 sec. Processed 780.68 thousand rows, 716.07 MB (132.16 thousand rows/s., 121.22 MB/s.)
0 rows in set. Elapsed: 5.417 sec. Processed 780.68 thousand rows, 716.07 MB (144.12 thousand rows/s., 132.19 MB/s.)
0 rows in set. Elapsed: 5.649 sec. Processed 780.68 thousand rows, 716.07 MB (138.21 thousand rows/s., 126.77 MB/s.)

后续:经过数轮优化:最快可达到4.2s,加速1.47x。优化包括

  • 每次prefetch之前,淘汰过时的buffer,以减少page fault
  • orc DataBuffer调用resize时会调用memset, 开销比较大,已去除
  • 限制range合并的上限值,充分利用io并发。

without prefetch

select rip, rtime, country, os, event from hdfs('hdfs://bigocluster/user/hive/warehouse/test.orc') settings max_threads = 1, max_parsing_threads = 1, remote_filesystem_read_prefetch = 0, remote_read_min_bytes_for_seek = 524288 format Null; 
0 rows in set. Elapsed: 11.423 sec. Processed 780.68 thousand rows, 716.07 MB (68.34 thousand rows/s., 62.69 MB/s.)
0 rows in set. Elapsed: 13.590 sec. Processed 780.68 thousand rows, 716.07 MB (57.44 thousand rows/s., 52.69 MB/s.)
0 rows in set. Elapsed: 7.953 sec. Processed 780.68 thousand rows, 716.07 MB (98.16 thousand rows/s., 90.04 MB/s.)
0 rows in set. Elapsed: 6.614 sec. Processed 780.68 thousand rows, 716.07 MB (118.04 thousand rows/s., 108.27 MB/s.)
0 rows in set. Elapsed: 7.343 sec. Processed 780.68 thousand rows, 716.07 MB (106.32 thousand rows/s., 97.52 MB/s.)
0 rows in set. Elapsed: 6.905 sec. Processed 780.68 thousand rows, 716.07 MB (113.06 thousand rows/s., 103.70 MB/s.)
0 rows in set. Elapsed: 6.442 sec. Processed 780.68 thousand rows, 716.07 MB (121.18 thousand rows/s., 111.15 MB/s.)
0 rows in set. Elapsed: 6.178 sec. Processed 780.68 thousand rows, 716.07 MB (126.36 thousand rows/s., 115.90 MB/s.)
0 rows in set. Elapsed: 6.471 sec. Processed 780.68 thousand rows, 716.07 MB (120.64 thousand rows/s., 110.66 MB/s.)
0 rows in set. Elapsed: 7.440 sec. Processed 780.68 thousand rows, 716.07 MB (104.93 thousand rows/s., 96.25 MB/s.)

@taiyang-li
Copy link
Copy Markdown
Collaborator Author

taiyang-li commented Sep 26, 2024

realtime flamegraph

with prefetch
real_w_prefetch

without prefetch

real_wo_prefetch

@taiyang-li
Copy link
Copy Markdown
Collaborator Author

Close becuase of ClickHouse#70534

@taiyang-li taiyang-li closed this Oct 10, 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