A dedicated unikernel for microservices

Sunday, June 24, 2018

Reducing CPU usage on Toro guests, "The numbers"

Hello folks! I experimented around the last improvement of Toro regarding with reducing the energy consumption. I want to thank my very closed friend Cesar Bernardini for the experiments. In the tests, we compare an Ubuntu guest with a Toro guest on Qemu. We set up a 2 core machine with 256MB per core. To bench each kernel, we generate N http requests and then we stop, we repeat it every X time. Then, we measure the CPU usage of the Qemu process by using top. Then, we get the following graphs:

Toro without any improvement:
In this graph, you can see that Qemu's process is at 100% all the time. 

Toro with improvements:

With the improvements, Qemu's process is at 100%  only when traffic is received.  

Ubuntu guest:

When Ubuntu is on, i.e., when traffic is received, Qemu's process uses between ~40%...60%, then , when there is no trafic, cpu usage downs to around ~ 0%..15%.

In the next experiments, we incress the number of messages.

Toro guest:
When the number of messages is incressed, the Toro guest footprint does not change.

Ubuntu guest:
In the case of a Ubuntu guest, the cpu usage of the Qemu process reaches the 100% during traffic. This means that Ubuntu is correctly scaling the cpu usage on demand. 

Take Away Lessons:

- In production, CPU usage of Guests is important because the VCPUs are a shared resource
- The approach in Toro has reduced the CPU usage in a half, however a an overall power management solution must also scale the CPU, i.e., processor in P-State
- The approaches may depend on the hypervisor and its ability to emulate/virtualize the instructions related with power consumption, e.g., mwat/mcontrol

No comments: