Skip to content

Commit e8bfadf

Browse files
authored
(8/5) Reduce VMM reservation contention (#7533)
#7498 was introduced to benchmark the cost of concurrent instance provisioning, and it demonstrated that through contention, performance can be significantly on the VMM reservation pathway. This PR optimizes that pathway, by removing the VMM reservation transaction, and instead replacing it with some non-transactional queries: 1. First, we query to see if the VMM reservation has already succeeded (for idempotency) 2. Next, we query for all viable sled targets and affinity information (`sled_find_targets_query`) 3. After parsing that data and picking a sled, we call `sled_insert_resource_query` to INSERT a desired VMM record, and to re-validate our constraints. This change significantly improves performance in the `vmm-reservation` benchmark, while upholding the necessary constraints implicit to VMM provisioning.
1 parent 0abc01f commit e8bfadf

File tree

8 files changed

+1067
-842
lines changed

8 files changed

+1067
-842
lines changed

nexus/db-queries/src/db/datastore/sled.rs

Lines changed: 469 additions & 172 deletions
Large diffs are not rendered by default.

nexus/db-queries/src/db/queries/affinity.rs

Lines changed: 0 additions & 611 deletions
This file was deleted.

nexus/db-queries/src/db/queries/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
//! Specialized queries for inserting database records, usually to maintain
66
//! complex invariants that are most accurately expressed in a single query.
77
8-
pub mod affinity;
98
pub mod disk;
109
pub mod external_ip;
1110
pub mod ip_pool;
@@ -14,6 +13,7 @@ mod next_item;
1413
pub mod network_interface;
1514
pub mod oximeter;
1615
pub mod region_allocation;
16+
pub mod sled_reservation;
1717
pub mod virtual_provisioning_collection_update;
1818
pub mod vpc;
1919
pub mod vpc_subnet;

0 commit comments

Comments
 (0)