| Files | Last commit | Last update |
|---|---|---|
perf(orchestrator): use a single NBD connection per device on Linux 4.19 Each socket attached to an NBD device goes through nbd_add_socket, which freezes the device's block queue, and starting a device with more than one connection resizes its hardware queues under another freeze. The nbd netlink commands of all devices run under one kernel-wide genetlink lock, so concurrent sandbox starts queue behind these freezes. With the default of four connections, each device start goes through five of them. On Linux 4.19 a freeze is slow. On an openEuler 20.03 host (Linux 4.19.90, aarch64) with the distribution's nbd module, a userspace benchmark that connects devices through the same nbdnl calls as DirectPathMount measured about 21 ms per freeze on an idle host and 100-200 ms with sandboxes running. Concurrent connects ran one after another, and a single-connection connect took about a fifth of the time of a four-connection one. Together with the 1 ms status polling from "perf(orchestrator): stop spin-polling NBD status after connect/disconnect", the mean create time of 50 and 100 concurrent sandboxes on that host went from 4.9 s to 1.40 s and from 8.9 s to 3.17 s. Use one connection per device on 4.19 hosts, detected by a new hostkernel package. Fewer connections also mean fewer device queues; throughput under sustained parallel I/O was not compared. Other kernels keep the feature-flag value. cherry-pick merge request: perf(orchestrator): use a single NBD connection per device on Linux 4.19 6de46a85d79bc3e4968be4f62bcd15d84c4c2660 This cherry-pick merge request !240 | 29 days ago | |
迁移e2b仓库的代码 | 4 months ago | |
迁移e2b仓库的代码 | 4 months ago | |
perf(orchestrator): use a single NBD connection per device on Linux 4.19 Each socket attached to an NBD device goes through nbd_add_socket, which freezes the device's block queue, and starting a device with more than one connection resizes its hardware queues under another freeze. The nbd netlink commands of all devices run under one kernel-wide genetlink lock, so concurrent sandbox starts queue behind these freezes. With the default of four connections, each device start goes through five of them. On Linux 4.19 a freeze is slow. On an openEuler 20.03 host (Linux 4.19.90, aarch64) with the distribution's nbd module, a userspace benchmark that connects devices through the same nbdnl calls as DirectPathMount measured about 21 ms per freeze on an idle host and 100-200 ms with sandboxes running. Concurrent connects ran one after another, and a single-connection connect took about a fifth of the time of a four-connection one. Together with the 1 ms status polling from "perf(orchestrator): stop spin-polling NBD status after connect/disconnect", the mean create time of 50 and 100 concurrent sandboxes on that host went from 4.9 s to 1.40 s and from 8.9 s to 3.17 s. Use one connection per device on 4.19 hosts, detected by a new hostkernel package. Fewer connections also mean fewer device queues; throughput under sustained parallel I/O was not compared. Other kernels keep the feature-flag value. cherry-pick merge request: perf(orchestrator): use a single NBD connection per device on Linux 4.19 6de46a85d79bc3e4968be4f62bcd15d84c4c2660 This cherry-pick merge request !240 | 29 days ago | |
feat(orchestrator,cri-multiplex): adapt per-sandbox egress proxy to Android sandboxes Design doc section 19: extend the per-netns per-sandbox proxy to the orchestrator StratoVirt Android path, e2e-verified on the android14 template (s91a01in783yklo27322). - network (19.3): install the E2B_EGRESS_PROXY redirect jump on both tap0 and cvd-mtap (Slot.egressProxyTapIfs) so Android guest traffic via mtap is intercepted; rules build/remove/state-probe are per-iface now, with idempotent append-only jumps. Linux guests are unaffected (cvd-mtap exists on every native slot; the extra jump is a dead rule there) - CA injection (19.4): dispatch by VMMConfig.OsType; Android sandboxes go through the ADB channel (egress_ca_adb.go) — connect via the per-sandbox vsock proxy address, SHA-256 fingerprint idempotency probe, adb root/remount (fail-fast with guidance on user builds), push to /system/etc/security/cacerts/<subject_hash_old>.0, chmod 0644 + restorecon, read-back verify with CRLF normalization. The hash file name is computed in Go (md5 of RawSubject, little-endian, matching openssl -subject_hash_old); adb binary from SANDBOX_ADB_BINARY (default "adb") - expose-ports needs no guest-side forward hop (19.5 dropped): the real Android topology puts both guest NICs inside Android itself, so the netns DNAT target 169.254.0.21 is already Android-local and hostport traffic reaches listeners directly; the initially built E2B_EXPOSE_FORWARD hop was verified redundant in e2e and removed - xtables.lock hardening found by the e2e run: add -w 5 to the raw iptables/iptables-restore execs (egress_proxy.go, network.go, cri-multiplex hostport.go) and Timeout(5) to the go-iptables handles, so concurrent slot warm-up / hostport installs no longer fail sandbox creation with "Can't lock /run/xtables.lock" 19.2 (OsType gating in ResolveEgressMode) deliberately not implemented: 19.3 closes the silent-bypass window, so Android sandboxes follow the same per-sandbox derivation rules as Linux. e2e on android14: dual-iface redirect installed, mitmdump up in the slot netns, CA injected into the Android system trust store (ADB channel), HTTPS from Android returns 200 with peer issuer = proxy CA, expose-ports all three forms connect from the host without any guest-side hop. | 1 month ago |