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
Enable configuration of local store size limits #11777
Conversation
5bdd6a4
to
97059c5
Compare
register( | ||
"--local-store-processes-max-size-bytes", | ||
type=int, | ||
advanced=True, | ||
help=( | ||
"The maximum size in bytes of the local store containing process cache entries. " | ||
f"Stored below `{local_store_dir_flag}`." | ||
), | ||
default=DEFAULT_LOCAL_STORE_OPTIONS.processes_max_size_bytes, | ||
) | ||
register( | ||
"--local-store-files-max-size-bytes", | ||
type=int, | ||
advanced=True, | ||
help=( | ||
"The maximum size in bytes of the local store containing files. " | ||
f"Stored below `{local_store_dir_flag}`." | ||
"\n\n" | ||
"NB: This size value bounds the total size of all files, but (due to sharding of the " | ||
"store on disk) it also bounds the per-file size to (VALUE / 16)." | ||
"\n\n" | ||
"This value doesn't reflect space allocated on disk, or RAM allocated (it " | ||
"may be reflected in VIRT but not RSS). However, the default is lower than you " | ||
"might otherwise choose because macOS creates core dumps that include MMAP'd " | ||
"pages, and setting this too high might cause core dumps to use an unreasonable " | ||
"amount of disk if they are enabled." | ||
), | ||
default=DEFAULT_LOCAL_STORE_OPTIONS.files_max_size_bytes, | ||
) | ||
register( | ||
"--local-store-directories-max-size-bytes", | ||
type=int, | ||
advanced=True, | ||
help=( | ||
"The maximum size in bytes of the local store containing directories. " | ||
f"Stored below `{local_store_dir_flag}`." | ||
), | ||
default=DEFAULT_LOCAL_STORE_OPTIONS.directories_max_size_bytes, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One potential alternative to exposing all three options would be to expose one option, and to then bake in a ratio.
…ured, and unify them with StoreGCService settings. [ci skip-rust] [ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
97059c5
to
f1fb18b
Compare
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
### Problem The top commit in #11777 was marked `skip-rust`, and so ... the rust tests were skipped while landing. After landing, it failed on main. ### Solution Fix the test. Independently, we should follow up to fix the implementation of the `skip-rust` tag.
def target_total_size_bytes(self) -> int: | ||
"""Returns the target total size of all of the stores. | ||
|
||
The `max_size` values are caps on the total size of each store: the "target" size | ||
is the size that garbage collection will attempt to shrink the stores to each time | ||
it runs. | ||
|
||
NB: This value is not currently configurable, but that could be desirable in the future. | ||
""" | ||
max_total_size_bytes = ( | ||
self.processes_max_size_bytes | ||
+ self.files_max_size_bytes | ||
+ self.directories_max_size_bytes | ||
) | ||
return max_total_size_bytes // 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fact that this is calculated from the new higher default ended up changing the concrete target to a higher value.
Problem
The local
Store
uses LMDB, which requires you to pre-specify the maximum store size for the purposes of MMAP.Unfortunately, our previously lowered
Store
size values (#11513) put too low a cap on file sizes for some users.Solution
Make the maximum sizes of the stores configurable, and calculate the target store size for GC from the maximum size.
Result
Users can increase the maximum sizes of the stores to support larger file sizes.