cleanup: remove project-open stage timing logs, lower NIO-added log to debug

- Drop the diagnostic stage-timing logs added during link-create perf
  work (nodes / preallocate / prepare / dispatch) now that bottlenecks
  are resolved and verified.
- Lower the per-NIO 'added to adapter' log in docker_vm from INFO to
  DEBUG — at 5000+ NIOs per project open it floods the log at INFO.
This commit is contained in:
YueGuobin 2026-08-11 00:14:58 +08:00
parent c9a93c0aeb
commit e2fd922922
No known key found for this signature in database
2 changed files with 1 additions and 11 deletions

View File

@ -1275,7 +1275,7 @@ class DockerVM(BaseNode):
await self._connect_nio(adapter_number, nio)
adapter.add_nio(0, nio)
log.info(
log.debug(
"Docker container '{name}' [{id}]: {nio} added to adapter {adapter_number}".format(
name=self.name, id=self._id, nio=nio, adapter_number=adapter_number
)

View File

@ -1710,14 +1710,11 @@ class Project:
# Create nodes in parallel with limited concurrency
# to avoid overwhelming the system with too many simultaneous operations
_stage_t0 = time.time()
pool = Pool(concurrency=100)
for compute, name, node_id, node_data in nodes_to_create:
pool.append(self.add_node, compute, name, node_id, dump=False, **node_data)
await pool.join()
log.info("Project open stage timing: nodes=%d created in %.2fs", len(nodes_to_create), time.time() - _stage_t0)
# Pre-allocate UDP ports for all links in batch to reduce HTTP round-trips
_stage_t1 = time.time()
ports_per_compute = {}
for link_data in topology.get("links", []):
if "link_id" not in link_data.keys():
@ -1730,7 +1727,6 @@ class Project:
count = ports_per_compute.get(compute.id, 0)
if count > 0:
await self.preallocate_udp_ports_for_compute(compute, count)
log.info("Project open stage timing: preallocate ports in %.2fs", time.time() - _stage_t1)
# Create links via the bulk path: build every link locally (no NIO
# HTTP), then dispatch all NIOs to each compute in a single batch
# request. This replaces one HTTP round-trip per link (~5000 for a
@ -1748,7 +1744,6 @@ class Project:
prepared = await asyncio.gather(*[_prepare_one(d) for d in link_data_list])
valid = [p for p in prepared if p is not None]
log.info("Project open stage timing: prepare %d links in %.2fs", len(link_data_list), time.time() - _stage_t1)
# Group the prepared NIO entries by destination compute and send
# each compute a single /nios/batch request.
@ -1772,14 +1767,9 @@ class Project:
)
if per_compute:
_stage_t2 = time.time()
await asyncio.gather(
*[_dispatch_batch(c, n) for c, n in per_compute.items()]
)
log.info(
"Project open stage timing: batch dispatch %d NIOs across %d compute(s) in %.2fs",
sum(len(n) for n in per_compute.values()), len(per_compute), time.time() - _stage_t2
)
# Finalise every link: wire node/port back-references, mark created,
# notify clients, and apply project-level marker definitions.