The startup latency is the primary optimisation target for Erlang on Xen. The preliminary measurements presented below hint that Ling starts approximately 400x faster than Linux+BEAM combo.
On average, only 49ms passes between two moments when the Ling guest kernel is entered and the first Erlang instruction is executed by the virtual machine. The corresponding time for the traditional Linux+BEAM combination exceeds 20s.
The startup latency was measured 10 times for both Ling and Linux+BEAM. The highest value was discarded in both cases. The remaining 9 values were averaged. The raw latency data is presented in the table below. All values are in milliseconds.
Run | Linux+BEAM | Ling |
---|---|---|
1 | 77 | |
2 | 29,696 | 55 |
3 | 19,198 | 39 |
4 | 16,843 | 24 |
5 | 26,128 | 60 |
6 | 16,543 | 28 |
7 | 18,255 | 48 |
8 | 27,496 | |
9 | 16,303 | 69 |
10 | 16,962 | 42 |
Average | 20,825 | 49 |
The Xen guest image for Linux+BEAM was created using Suse Studio (susestudio.com). The minimal (JeOS) Linux configuration was selected. Erlang OTP R15B01 was added to the image. The startup time of the instance was obtained from the output of ‘dmesg’ command.
The specifications of the testing platform:
The Linux+BEAM Xen image was not optimized for the fast start except choosing a “Just Enough Operating System” configuration. Other Linux distributions may start faster than OpenSUSE. However, it is unlikely that an optimized Linux+BEAM image will show latency similar to Erlang on Xen.
Most of the startup latency for Ling is related to preparation of the memory mapping. Optimizations in the area may result in further reductions of the latency.
This page will be updated regularly, when new latency data become available. You are welcome to build a Xen image for your application and check how fast it starts.