3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Debian の HVM 仮想マシンに、Ubuntu を上書きインストール

Last updated at Posted at 2015-08-20

CentOS 6.x 仮想サーバーのカスタム化 に続いて、Debian系OS についても、同様な手法で HVM 仮想マシンを作って、性能改善を試みます。

Ubuntu 14.04 のUnixbench 結果##

Ubuntu 14.04 は、ソフトレイヤーの仮想マシンとしてh、PVで動作しているため、以下のとおりベンチマーク結果は思わしくない値になっています。

Ununtu14.04
========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: tkr32: GNU/Linux
   OS: GNU/Linux -- 3.13.0-55-generic -- #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz (4000.1 bogomips)
          Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   06:21:34 up  1:36,  1 user,  load average: 0.45, 0.24, 0.12; runlevel 2

------------------------------------------------------------------------
Benchmark Run: Wed Aug 19 2015 06:21:34 - 06:49:48
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       23205108.3 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2980.4 MWIPS (9.8 s, 7 samples)
Execl Throughput                               1273.9 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        307910.9 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks           79064.3 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1081678.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                              422892.9 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                  80137.8 lps   (10.0 s, 7 samples)
Process Creation                               2604.3 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   3048.2 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    405.1 lpm   (60.1 s, 2 samples)
System Call Overhead                         386480.8 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   23205108.3   1988.4
Double-Precision Whetstone                       55.0       2980.4    541.9
Execl Throughput                                 43.0       1273.9    296.3
File Copy 1024 bufsize 2000 maxblocks          3960.0     307910.9    777.6
File Copy 256 bufsize 500 maxblocks            1655.0      79064.3    477.7
File Copy 4096 bufsize 8000 maxblocks          5800.0    1081678.7   1865.0
Pipe Throughput                               12440.0     422892.9    339.9
Pipe-based Context Switching                   4000.0      80137.8    200.3
Process Creation                                126.0       2604.3    206.7
Shell Scripts (1 concurrent)                     42.4       3048.2    718.9
Shell Scripts (8 concurrent)                      6.0        405.1    675.2
System Call Overhead                          15000.0     386480.8    257.7
                                                                   ========
System Benchmarks Index Score                                         519.8

Debian 8.1 の結果##

これに対して、Debian 8.1 は、HVMモードの仮想マシンとして、動作しているために、ベンチマーク結果は、クラウド業界の他社のマシンと比較しても良好な結果を得ることができます。

Debina8.1
========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: tkr31: GNU/Linux
   OS: GNU/Linux -- 3.16.0-4-amd64 -- #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24)
   Machine: x86_64 (unknown)
   Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
   CPU 0: Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz (4000.1 bogomips)
          x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   06:21:50 up  1:40,  1 user,  load average: 0.15, 0.12, 0.08; runlevel 5

------------------------------------------------------------------------
Benchmark Run: Wed Aug 19 2015 06:21:50 - 06:50:04
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       23688552.4 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2925.1 MWIPS (9.8 s, 7 samples)
Execl Throughput                               4278.8 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        891102.5 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          239674.0 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       2647651.5 KBps  (30.0 s, 2 samples)
Pipe Throughput                             1655607.1 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 322133.5 lps   (10.0 s, 7 samples)
Process Creation                              12296.2 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   7406.7 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    973.1 lpm   (60.1 s, 2 samples)
System Call Overhead                        3260747.1 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   23688552.4   2029.9
Double-Precision Whetstone                       55.0       2925.1    531.8
Execl Throughput                                 43.0       4278.8    995.1
File Copy 1024 bufsize 2000 maxblocks          3960.0     891102.5   2250.3
File Copy 256 bufsize 500 maxblocks            1655.0     239674.0   1448.2
File Copy 4096 bufsize 8000 maxblocks          5800.0    2647651.5   4564.9
Pipe Throughput                               12440.0    1655607.1   1330.9
Pipe-based Context Switching                   4000.0     322133.5    805.3
Process Creation                                126.0      12296.2    975.9
Shell Scripts (1 concurrent)                     42.4       7406.7   1746.9
Shell Scripts (8 concurrent)                      6.0        973.1   1621.9
System Call Overhead                          15000.0    3260747.1   2173.8
                                                                   ========
System Benchmarks Index Score                                        1471.4

仮想マシン環境の違いの確認

原因を一応確認しておきます。 カーネルの起動メッセージから、Ubuntuでは PV、 Debian では HVM になっている事がわかります。

Ubuntu14.04
root@tkr32:~# uname -a
Linux tkr32 3.13.0-55-generic #94-Ubuntu SMP Thu Jun 18 00:27:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
root@tkr32:~# dmesg |grep Xen
[    0.000000] Xen: [mem 0x0000000000000000-0x000000000009ffff] usable
[    0.000000] Xen: [mem 0x00000000000a0000-0x00000000000fffff] reserved
[    0.000000] Xen: [mem 0x0000000000100000-0x000000003fffffff] usable
[    0.000000] Booting paravirtualized kernel on Xen
[    0.000000] Xen version: 4.1.5 (preserve-AD)
[    0.000000] Xen: using vcpuop timer interface
[    0.000000] installing Xen timer for CPU 0
[    0.098282] PCI: setting up Xen PCI frontend stub
[    0.166435] xen_netfront: Initialising Xen virtual ethernet driver
Debian8.1
root@tkr31:~# uname -a   
Linux tkr31 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 GNU/Linux
root@tkr31:~# dmesg |grep Xen
[    0.000000] DMI: Xen HVM domU, BIOS 4.1.5 11/28/2013
[    0.000000] Hypervisor detected: Xen HVM
[    0.000000] Xen version 4.1.
[    0.000000] Xen Platform PCI: I/O protocol version 1
[    0.000000] Netfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated NICs.
[    0.000000] Blkfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated disks.

Ubuntu OS イメージを Debian OS の仮想マシンに上書き

前回と同じ様に、レスキュー・カーネルで起動して、Ubuntu 14.04 ディスクのRAWイメージをDebian 8.1
の仮想マシンのブート・ディスクに上書きして、Ubuntu 14.04 を HVM仮想マシンにします。 以下の起動時のカーネルメッセージです。 確かに HVM 仮想マシンに変わっていることがわかります。

root@tkr33:~# uname -a
Linux tkr33 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
root@tkr33:~# dmesg |grep Xen
[    0.000000] DMI: Xen HVM domU, BIOS 4.1.5 11/28/2013
[    0.000000] Hypervisor detected: Xen HVM
[    0.000000] Xen version 4.1.
[    0.000000] Xen Platform PCI: I/O protocol version 1
[    0.000000] Netfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated NICs.
[    0.000000] Blkfront and the Xen platform PCI driver have been compiled for this kernel: unplug emulated disks.

Ubuntu は、 Debian ディストリビューションを元にして、作られているので、設定ファイルに共通部分が多く、CentOS 6 と CentOS 7 の様な大幅な変更がありません。 この事によって、 Debian に Ubuntu を上書きして、再起動した後に、 イメージテンプレートを取得して、このイメージから仮想マシンを起動する事ができます。 途中で止まるといった事はありませんでした。

Ubuntu 14.04 on HVM のベンチマーク結果

確かに、PV 時のベンチマーク値の倍近いの性能値となっていますが、Debian 8.1 の時の性能と比べると、あまり良くありません。 ここで用いたUbuntu 14.04 は、 Xen v4.4 の仮想環境で、ISOイメージからインストールしたディスクの raw ディスク・イメージから作ったものです。 Debian 8.1 HVM仮想環境に対してチューニングされていたと思われます。

========================================================================
   BYTE UNIX Benchmarks (Version 5.1.3)

   System: tkr33: GNU/Linux
   OS: GNU/Linux -- 3.13.0-24-generic -- #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014
   Machine: x86_64 (x86_64)
   Language: en_US.utf8 (charmap="UTF-8", collate="UTF-8")
   CPU 0: Intel(R) Xeon(R) CPU E5-2683 v3 @ 2.00GHz (4000.1 bogomips)
          x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET
   01:39:56 up 8 min,  1 user,  load average: 0.48, 0.51, 0.24; runlevel 2

------------------------------------------------------------------------
Benchmark Run: Thu Aug 20 2015 01:39:56 - 02:08:09
1 CPU in system; running 1 parallel copy of tests

Dhrystone 2 using register variables       23216142.4 lps   (10.0 s, 7 samples)
Double-Precision Whetstone                     2982.1 MWIPS (9.8 s, 7 samples)
Execl Throughput                               2941.8 lps   (30.0 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks        444135.2 KBps  (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks          114926.5 KBps  (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks       1486421.7 KBps  (30.0 s, 2 samples)
Pipe Throughput                              585781.4 lps   (10.0 s, 7 samples)
Pipe-based Context Switching                 155657.6 lps   (10.0 s, 7 samples)
Process Creation                               9615.4 lps   (30.0 s, 2 samples)
Shell Scripts (1 concurrent)                   5639.0 lpm   (60.0 s, 2 samples)
Shell Scripts (8 concurrent)                    729.0 lpm   (60.0 s, 2 samples)
System Call Overhead                         398018.6 lps   (10.0 s, 7 samples)

System Benchmarks Index Values               BASELINE       RESULT    INDEX
Dhrystone 2 using register variables         116700.0   23216142.4   1989.4
Double-Precision Whetstone                       55.0       2982.1    542.2
Execl Throughput                                 43.0       2941.8    684.1
File Copy 1024 bufsize 2000 maxblocks          3960.0     444135.2   1121.6
File Copy 256 bufsize 500 maxblocks            1655.0     114926.5    694.4
File Copy 4096 bufsize 8000 maxblocks          5800.0    1486421.7   2562.8
Pipe Throughput                               12440.0     585781.4    470.9
Pipe-based Context Switching                   4000.0     155657.6    389.1
Process Creation                                126.0       9615.4    763.1
Shell Scripts (1 concurrent)                     42.4       5639.0   1329.9
Shell Scripts (8 concurrent)                      6.0        729.0   1214.9
System Call Overhead                          15000.0     398018.6    265.3
                                                                   ========
System Benchmarks Index Score                                         816.9

3
3
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?