qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Sergio Lopez <slp@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: berrange@redhat.com, ehabkost@redhat.com, mst@redhat.com,
	philmd@redhat.com, groug@kaod.org, qemu-devel@nongnu.org,
	marcandre.lureau@gmail.com, kraxel@redhat.com,
	imammedo@redhat.com, pbonzini@redhat.com, rth@twiddle.net,
	lersek@redhat.com, sgarzare@redhat.com
Subject: Re: [PATCH v11 00/15] Introduce the microvm machine type
Date: Mon, 02 Dec 2019 14:01:42 +0100	[thread overview]
Message-ID: <87k17e3mq1.fsf@redhat.com> (raw)
In-Reply-To: <87imn58gyd.fsf@dusky.pond.sub.org>

[-- Attachment #1: Type: text/plain, Size: 3282 bytes --]


Markus Armbruster <armbru@redhat.com> writes:

> Sergio Lopez <slp@redhat.com> writes:
>
>> microvm is a machine type inspired by Firecracker and constructed
>> after its machine model.
>>
>> It's a minimalist machine type without PCI nor ACPI support, designed
>> for short-lived guests. microvm also establishes a baseline for
>> benchmarking and optimizing both QEMU and guest operating systems,
>> since it is optimized for both boot time and footprint.
>
> I know this has been merged, but I ask anyway: got some boot time and
> memory footprint measurements?

It's been a while since I ran an instrumented kernel, but I've been
playing a bit with OSv (thanks to a question in qemu-discuss), which is
aggressively optimized for boot time, and I have some numbers.

This is using a QEMU build with some patches to be able to do a
microvm-only build that "I have not yet submitted but shouldn't be
controversial" (TM) [1]. The Q35 binary was also built having only the
Q35 machine type enabled.

In this test, OSv runs to userspace and then shuts down. OSv gives us
its boot time (from entry point to userspace), and I also get the
execution totals with "time". Variation between runs is +-2%:

------------
| qemu-q35 |
------------

Boot time
=========

time ./x86_64-softmmu/qemu-system-x86_64 -M q35 -enable-kvm \
 -cpu host -m 64m -kernel ~/osv/build/release/loader-stripped.elf \
 -append "/hello" -serial stdio -nodefaults -no-user-config \
 -nographic -no-reboot -device virtio-blk,id=blk0,drive=hd0,scsi=off \
 -drive file=~/osv/build/release/usr.img,if=none,id=hd0,cache=none \
 -global virtio-mmio.force-legacy=off -no-reboot

SeaBIOS (version rel-1.12.0-59-gc9ba5276e321-prebuilt.qemu.org)
Booting from ROM..OSv v0.54.0-26-gcccc7d40
Booted up in 11.77 ms
Cmdline: /hello
Hello from C code

real    0m0.073s
user    0m0.034s
sys     0m0.029s


Size
====

# ls -l x86_64-softmmu/qemu-system-x86_64*
-rwxr-xr-x. 1 root root 13400680 Dec  2 07:31 x86_64-softmmu/qemu-system-x86_64
-rwxr-xr-x. 1 root root 11707344 Dec  2 07:51 x86_64-softmmu/qemu-system-x86_64.stripped


----------------
| qemu-microvm |
----------------

Boot time
=========

time ./x86_64-softmmu/qemu-system-x86_64 -M microvm -enable-kvm \
 -cpu host -m 64m -smp 1 \
 -kernel ~/osv/build/release/loader-stripped.elf \
 -append "--nopci /hello" -serial stdio -nodefaults -no-user-config \
 -nographic -no-reboot \
 -device virtio-blk-device,id=blk0,drive=hd0,scsi=off \
 -drive file=~/osv/build/release/usr.img,if=none,id=hd0 \
 -global virtio-mmio.force-legacy=off 

OSv v0.54.0-26-gcccc7d40
Booted up in 3.64 ms
Cmdline: /hello 
Hello from C code

real	0m0.020s
user	0m0.009s
sys     0m0.011s


Size
====

# ls -l x86_64-softmmu/qemu-system-x86_64*
-rwxr-xr-x. 1 root root 7823344 Dec  2 07:35 x86_64-softmmu/qemu-system-x86_64
-rwxr-xr-x. 1 root root 6486992 Dec  2 07:55 x86_64-softmmu/qemu-system-x86_64.stripped


I don't have numbers for memory footprint. It'd be nice coming up with
some reasonable methodology for getting them, as there a significant
amount of moving parts there that can have an impact on memory
consumption.

Sergio.

[1] https://github.com/slp/qemu/tree/microvm_only

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

      reply	other threads:[~2019-12-02 13:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-18 10:53 [PATCH v11 00/15] Introduce the microvm machine type Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 01/15] hw/virtio: Factorize virtio-mmio headers Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 02/15] hw/i386/pc: rename functions shared with non-PC machines Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 03/15] hw/i386/pc: fix code style issues on functions that will be moved out Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 04/15] hw/i386/pc: replace use of strtol with qemu_strtoui in x86_load_linux() Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 05/15] hw/i386/pc: avoid an assignment in if condition " Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 06/15] hw/i386/pc: remove commented out code from x86_load_linux() Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 07/15] hw/i386/pc: move shared x86 functions to x86.c and export them Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 08/15] hw/i386: split PCMachineState deriving X86MachineState from it Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 09/15] hw/i386: make x86.c independent from PCMachineState Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 10/15] fw_cfg: add "modify" functions for all types Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 11/15] hw/intc/apic: reject pic ints if isa_pic == NULL Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 12/15] roms: add microvm-bios (qboot) as binary and git submodule Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 13/15] docs/microvm.rst: document the new microvm machine type Sergio Lopez
2019-10-18 10:53 ` [PATCH v11 14/15] hw/i386: Introduce the " Sergio Lopez
2019-10-30  9:25   ` Philippe Mathieu-Daudé
2019-10-30 14:18     ` Paolo Bonzini
2019-10-18 10:53 ` [PATCH v11 15/15] MAINTAINERS: add microvm related files Sergio Lopez
2019-11-27 15:41 ` [PATCH v11 00/15] Introduce the microvm machine type Markus Armbruster
2019-12-02 13:01   ` Sergio Lopez [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k17e3mq1.fsf@redhat.com \
    --to=slp@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=groug@kaod.org \
    --cc=imammedo@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=lersek@redhat.com \
    --cc=marcandre.lureau@gmail.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sgarzare@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).