archivebox.services.resource_admission
Measured resource pressure and memory headroom for capture admission.
Module Contents
Classes
Functions
Return zram block names and major:minor IDs known to sysfs. |
|
Identify a swap source by its visible name and, for block devices, ID. |
|
Sum free active swap except zram, whose capacity is already backed by RAM. |
|
Use only independently backed swap as extra capacity on Linux. |
Data
API
- archivebox.services.resource_admission.zram_swap_identifiers(sys_block: pathlib.Path = Path('/sys/block')) set[str][source]
Return zram block names and major:minor IDs known to sysfs.
- archivebox.services.resource_admission.swap_source_identifiers(filename: str) set[str][source]
Identify a swap source by its visible name and, for block devices, ID.
- archivebox.services.resource_admission.disk_backed_swap_free_bytes(swaps: str, zram_identifiers: set[str]) int[source]
Sum free active swap except zram, whose capacity is already backed by RAM.
- archivebox.services.resource_admission.host_swap_free_bytes(meminfo_swap_free: int) int[source]
Use only independently backed swap as extra capacity on Linux.
- class archivebox.services.resource_admission.ResourceAdmission[source]
Initialization
- additional_snapshot_slots(configured: int, active: int, observed_cost: int | None, *, crawl_id: str | None = None) int[source]
- static slots_for_headroom(configured: int, active: int, observed_cost: int | None, available: int) int[source]
- process_tree_memory() int | None[source]
Measure RAM and swap attributable to this runner and its children.