RFC: Tezt: compute peak memory usage per test
Context
Adds a few scripts for computing peak memory usage for tezt tests, using cgmemtime. The peak memory consumption recursively includes all processes launched by the test.
This requires cgmemtime, a Linux kernel >= 5.19 and csvkit:
./tezt_cgmemtime_all.sh | tee tezt_cgmemtime_all.csv # This will run all tezt, which will take a long time (~8hrs on my comp). Memory consumption results are written to stdout.
./tezt_cgmemtime_import.sh tezt_cgmemtime_all.csv # Imports the CSV file into the sqlite3 database tezt_cgmemtime_all.db for convenient processing
N=20 ./tezt_cgmemtime_top_pigs.sh tezt_cgmemtime_all.db # Prints the 20 most memory hungry tezts.
In the second commit, I also add the results for running the script on top of 1f11961a on master
Here are the 20 most memory hungry tezts from those results. Pointy haired manager might also browsing the results as a Google Spreadsheet:
Largest test consumers in terms of CHILD_RSS_HIGH:
title child_rss_high_mb
------------------------------------------------------------------------------------------------------------------ -----------------
FuzzRef: List (List.concat_map) 1531.234375
test lib scoru wasm: Durable snapshot (Uniformly distributed all operations. Initial size: 2000, 20000 operations) 1308.5859375
test lib scoru-wasm-fast: Memory access (load_bytes behaves the same on both memory implementations) 1257.79296875
test lib scoru wasm: WASM Encodings (Input and output buffers trees) 1008.26171875
tezos-crypto-shaX-props: SHA512_Props (SHA512_incremental_list) 998.68359375
test lib scoru wasm: Output (Output buffer) 978.4296875
test lib scoru-wasm-fast: Memory access (store_num behaves the same on both memory implementations) 936.609375
016-PtMumbai: Refutation_game: Refutation (Perfect against Info per level hater) 902.83984375
017-PtNairob: Refutation_game: Refutation (Perfect against Info per level hater) 897.89453125
alpha: Refutation_game: Refutation (Perfect against Info per level hater) 897.625
test lib scoru-wasm-fast: Memory access (store_bytes behaves the same on both memory implementations) 893.828125
017-PtNairob: interpretation (lambda_rec instruction with an infinite recursion) 859.8359375
016-PtMumbai: interpretation (lambda_rec instruction with an infinite recursion) 859.8046875
alpha: interpretation (lambda_rec instruction with an infinite recursion) 859.18359375
octez-codec dump encodings 821.62890625
017-PtNairob: proxy ([fst (split_key s)] is a prefix of [s]) 820.9609375
tezos-crypto-shaX-props: SHA256_Props (SHA256_incremental_list) 807.41015625
tezos-layer2-store: indexed-store-pbt (indexable store (parallel)) 703.75
test lib scoru wasm: Durable snapshot (Descending distributed all operations. Initial size: 2000, 3000 operations) 689.2109375
test lib scoru wasm: Durable snapshot (Stress-test operation write_value_exn. Initial size: 1000, 2000 operations) 680.08203125
Largest test consumers in terms of GROUP_MEM_HIGH:
title group_mem_high_mb
------------------------------------------- -----------------
p2p-swap-disable 4424.44921875
Mumbai: bootstrap: many nodes bootstrap 3946.23046875
Nairobi: bootstrap: many nodes bootstrap 3943.83984375
Alpha: bootstrap: many nodes bootstrap 3942.41796875
p2p-maintenance-init-expected_connections 3664.5390625
Nairobi: storage snapshot export and import 3008.0859375
Mumbai: storage snapshot export and import 3002.046875
Alpha: storage snapshot export and import 2930.01171875
Nairobi: forge block with wrong payload 2408.90234375
Mumbai: forge block with wrong payload 2395.34765625
Alpha: forge block with wrong payload 2393.75
Nairobi: forge fake block 2363.9296875
Mumbai: forge fake block 2363.63671875
Alpha: forge fake block 2363.43359375
Alpha: Nonce seed revelation 2362.3359375
Mumbai: Nonce seed revelation 2353.12109375
Nairobi: Nonce seed revelation 2351.125
Test [octez-admin-client p2p stat] 2347.13671875
Nairobi: check synchronization state 2269.78125
Alpha: check synchronization state 2253.53125
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Arvid Jakobsson