Repository navigation
Commit 94460c3
authored
perf: optimize Arrow-to-Parquet conversion and sync scheduling (#1784)
- add ordered forward Arrow IPC reading for metric conversion
- decode multiple small files and multi-batch files concurrently with bounded reader lanes
- pipeline metric row-group preparation and Parquet encoding while preserving output order
- parallelize metric sorting and column encoding
- add detailed Arrow-to-Parquet phase timings
- bound periodic Parquet group concurrency per stream
- allow configurable overlapping periodic local-sync cycles
- atomically isolate processing directories used by concurrent cycles
- serialize object-store sync and retain upload claims until staged files are removed
- refresh retained claims after deletion failures to prevent duplicate uploads
- avoid unnecessary schema cloning during batch adaptation
- document conversion sizing and concurrency formulas
- add coverage for reader ordering, dictionary batches, invalid files, and Parquet row-group correctness
Configuration:
New environment variables:
- MAX_PERIODIC_LOCAL_SYNC_CYCLES (default: 2):
maximum periodic local-sync cycles allowed to run concurrently
- METRIC_ARROW_READERS_PER_FILE (default: 4):
maximum parallel readers used for record batches within one metric Arrow file
increase for multi-batch Arrow files when decoding is slow and CPU is available
decrease for one-batch files or CPU contention
- METRIC_ARROW_READERS_IN_FLIGHT (default: 4):
maximum total Arrow reader lanes active per metric Parquet conversion
increase when many small Arrow files must be decoded and CPU/I/O has headroom
decrease when many datasets convert concurrently or CPU is saturated
- METRIC_ROW_GROUP_ENCODE_IN_FLIGHT (default: 2)
maximum metric row groups encoded concurrently per Parquet file
increase when Parquet encoding dominates and CPU/memory is available
decrease for wide schemas, high memory usage, or many concurrent conversions
- PARQUET_COLUMNS_PER_RAYON_TASK (default: 8)
minimum Parquet columns assigned to each Rayon encoding task
decrease to expose more column parallelism
increase for wide schemas or many concurrent conversions to reduce task-scheduling overhead1 parent 6459688 commit 94460c3
12 files changed
Lines changed: 1833 additions & 241 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
0 commit comments