Skip to content

Commit

Permalink
Merge pull request #823 from hyperrealist/reduce-target-page-bytesize
Browse files Browse the repository at this point in the history
reduce `TARGET_PAGE_BYTESIZE` to `8_000_000`
  • Loading branch information
danielballan authored Sep 30, 2024
2 parents 83f2920 + 988e759 commit 461f2e7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions databroker/mongo_normalized.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,9 @@ def populate_column(min_seq_num, max_seq_num):
(result,) = cursor
column.extend(result["column"])

# Aim for 10 MB pages to stay safely clear the MongoDB's hard limit
# Aim for 8 MB pages to stay safely clear the MongoDB's hard limit
# of 16 MB.
TARGET_PAGE_BYTESIZE = 10_000_000
TARGET_PAGE_BYTESIZE = 8_000_000

page_size = TARGET_PAGE_BYTESIZE // 8 # estimated row byte size is 8
boundaries = list(range(min_seq_num, 1 + max_seq_num, page_size))
Expand Down Expand Up @@ -959,9 +959,9 @@ def populate_columns(keys, min_seq_num, max_seq_num):
numpy.prod(data_key["shape"]) * 8
)

# Aim for 10 MB pages to stay safely clear the MongoDB's hard limit
# Aim for 8 MB pages to stay safely clear the MongoDB's hard limit
# of 16 MB.
TARGET_PAGE_BYTESIZE = 10_000_000
TARGET_PAGE_BYTESIZE = 8_000_000

# Fetch scalars all together.
if scalars:
Expand Down

0 comments on commit 461f2e7

Please sign in to comment.