OSv v0.54.0-34-gccb9cd12Booted up in 2.91 msCmdline: /hello Hello from C code
real 0m0.057suser 0m0.037ssys 0m0.020s
qemu-system-x86_64 \-m 64M \-smp 1 \--nographic \-kernel ./scripts/../build/last/loader-stripped.elf \-append "--nopci /hello" \-M microvm,x-option-roms=off,pit=off,pic=off,rtc=off \-nodefaults \-no-user-config \-no-reboot \-global virtio-mmio.force-legacy=off \-device virtio-blk-device,id=blk0,drive=hd0,scsi=off \-drive file=./build/last/usr.img,if=none,id=hd0,cache=writeback,aio=threads \-enable-kvm \-cpu host,+x2apic \-serial stdio
OSv v0.54.0-34-gccb9cd12eth0: 192.168.122.15Booted up in 4.30 msCmdline: /hello Hello from C code
./scripts/run.py -p qemu_microvm --nogdb --qemu-path <wherever_your_qemu_is>/qemu-system-x86_64 --nics 0 -c 1 -m 64M --block-device-cache writeback
./scripts/run.py -p qemu_microvm --nogdb --qemu-path <wherever_your_qemu_is>/qemu-system-x86_64 -c 1 -m 64M --block-device-cache writeback
> To unsubscribe from this group and stop receiving emails from it, send an email to osv...@googlegroups.com.
As you may have heard QEMU developers added new machine type: microvm - https://github.com/qemu/qemu/blob/master/docs/microvm.rst. It has been merged into master but not part of any official QEMU release. So if you want to try you need to build QEMU from the source.Recently I have played with it and eventually managed to boot OSv successfully on it after some adjustments (see some of my recent virtio code tweaks). And the same OSv ROFS image that would boot in ~5 ms on firecracker, can boot in only ~3ms on QEMU microvm.
OSv v0.54.0-34-gccb9cd12Booted up in 2.91 msCmdline: /helloHello from C codereal 0m0.057suser 0m0.037ssys 0m0.020s
OSv v0.54.0-40-g08466354 disk read (real mode): 0.00ms, (+0.00ms) uncompress lzloader.elf: 0.00ms, (+0.00ms) TLS initialization: 0.51ms, (+0.51ms) .init functions: 1.22ms, (+0.71ms) SMP launched: 1.55ms, (+0.32ms) VFS initialized: 1.76ms, (+0.21ms) Network initialized: 2.01ms, (+0.25ms) pvpanic done: 2.08ms, (+0.07ms) drivers probe: 2.12ms, (+0.04ms) drivers loaded: 2.70ms, (+0.59ms) ROFS mounted: 2.93ms, (+0.22ms) Total time: 2.93ms, (+0.00ms)
Cmdline: /hello Hello from C code
The 57ms at the end, that is 20 slower - what does *that* include that the 2.91ms figure didn't?
cat test_micro.sh
time /home/wkozaczuk/projects/qemu/bin/release/native/x86_64-softmmu/qemu-system-x86_64 \
-m 64M \-smp 1 \--nographic \
-kernel /home/wkozaczuk/projects/osv/scripts/../build/last/loader-stripped.elf \
-append "--nopci /hello" \-M microvm,x-option-roms=off,pit=off,pic=off,rtc=off \-nodefaults \-no-user-config \
-global virtio-mmio.force-legacy=off \-device virtio-blk-device,id=blk0,drive=hd0,scsi=off \-drive file=/home/wkozaczuk/projects/osv/build/last/usr.img,if=none,id=hd0,cache=writeback,aio=threads \-enable-kvm \-cpu host,+x2apic \-serial stdio
/test_micro.sh > /tmp/log
qemu-system-x86_64: terminating on signal 2
real 0m10.467suser 0m6.366ssys 0m3.328s
grep Hello /tmp/log | wc -l1772
- 6ms - average execution time including boo time
- 170 - number of executions per second
So in this scenario, we pay for QEMU overhead once.
--
You received this message because you are subscribed to the Google Groups "OSv Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osv-dev+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/287b75a3-b556-4ac4-a598-9f04323875fd%40googlegroups.com.
On Nov 26, 2019, at 09:47, Nadav Har'El <n...@scylladb.com> wrote:
As you may have heard QEMU developers added new machine type: microvm - https://github.com/qemu/qemu/blob/master/docs/microvm.rst. It has been merged into master but not part of any official QEMU release. So if you want to try you need to build QEMU from the source.Recently I have played with it and eventually managed to boot OSv successfully on it after some adjustments (see some of my recent virtio code tweaks). And the same OSv ROFS image that would boot in ~5 ms on firecracker, can boot in only ~3ms on QEMU microvm.
OSv v0.54.0-34-gccb9cd12Booted up in 2.91 msCmdline: /helloHello from C codereal 0m0.057suser 0m0.037ssys 0m0.020s
../configure --target-list=x86_64-softmmu --disable-user --disable-linux-user \
--disable-bsd-user --disable-docs --disable-guest-agent \
--disable-guest-agent-msi --disable-modules --disable-debug-tcg \
--disable-debug-info --disable-sparse --disable-gnutls \
--disable-nettle --disable-gcrypt --disable-auth-pam \
--disable-sdl --disable-sdl-image --disable-gtk --disable-vte \
--disable-curses --disable-iconv --disable-vnc \
--disable-vnc-sasl --disable-vnc-jpeg --disable-vnc-png \
--disable-cocoa --disable-virtfs --disable-mpath --disable-xen \
--disable-xen-pci-passthrough --disable-brlapi --disable-curl \
--disable-fdt --disable-bluez --disable-hax --disable-hvf \
--disable-whpx --disable-rdma --disable-pvrdma --disable-vde \
--disable-netmap --disable-linux-aio --disable-cap-ng \
--disable-attr --disable-vhost-net --disable-vhost-vsock \
--disable-vhost-scsi --disable-vhost-crypto \
--disable-vhost-kernel --disable-vhost-user --disable-spice \
--disable-rbd --disable-libiscsi --disable-libnfs \
--disable-smartcard --disable-libusb \
--disable-live-block-migration --disable-usb-redir \
--disable-lzo --disable-snappy --disable-bzip2 --disable-lzfse \
--disable-seccomp --disable-coroutine-pool --disable-glusterfs \
--disable-tpm --disable-libssh --disable-numa --disable-libxml2 \
--disable-tcmalloc --disable-jemalloc --disable-avx2 \
--disable-replication --disable-opengl --disable-virglrenderer \
--disable-xfsctl --disable-qom-cast-debug --disable-tools \
--disable-vxhs --disable-bochs --disable-cloop --disable-dmg \
--disable-qcow1 --disable-vdi --disable-vvfat --disable-qed \
--disable-parallels --disable-sheepdog --disable-crypto-afalg \
--disable-capstone --disable-debug-mutex --disable-libpmem \
--disable-xkbcommon