RAKSUL TechBlog

ラクスルグループのエンジニアが技術トピックを発信するブログです

AWSのt2.nanoを使ってみた

AWSがt2.microよりさらに小さいt2.nanoをリリースしました。
サービスの詳細に関しては EC2アップデートー T2.Nanoインスタンスが利用可能に
参照してください。スペック的には下記の通りです。

Instance Type CPU Memory 価格($/時) 価格($/月) 価格(¥/月)
t2.nano 1 0.5GB $0.01 $07.3 ¥0,891
t2.micro 1 1.0GB $0.02 $14.6 ¥1,781
t2.small 1 2.0GB $0.04 $29.2 ¥3,562
t2.medium 2 4.0GB $0.08 $58.4 ¥7,125

($1.00 = ¥122で計算 2015/12/18時点)

インスタンスを立ち上げる


AWSの画面からインスタンスの作成を選択

インスタンスの作成

Amazon Linuxで今回は検証します

ステップ 1: Amazon マシンイメージ(AMI)

t2.nanoが選択できるようになっています。
ここで注意なのがt2.nanoは無料対称枠ではないようです。
個人的にはmicroの倍の期間かnanoが2台無料だったらいいなとか、、、

ステップ 2: インスタンスタイプの選択

インスタンスを起動します。
無事起動しました。

t2.nano

約500,000KB (491MB) のメモリです。

[shell] [ec2-user@ip-172-31-4-4 ~]$ free total used free shared buffers cached Mem: 503380 466504 36876 64 20020 352880 -/+ buffers/cache: 93604 409776 Swap: 0 0 0 [/shell]

[shell] [ec2-user ~]$ free -m total used free shared buffers cached Mem: 491 310 181 0 8 250 -/+ buffers/cache: 51 439 Swap: 0 0 0 [/shell]

CPU Infoも見てみます。

[shell] $ cat /proc/cpuinfo processor : 0 vendor_id : GenuineIntel cpu family : 6 model : 63 model name : Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz stepping : 2 microcode : 0x2b cpu MHz : 2400.040 cache size : 30720 KB physical id : 0 siblings : 1 core id : 0 cpu cores : 1 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 13 wp : yes flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt bugs : bogomips : 4800.08 clflush size : 64 cache_alignment : 64 address sizes : 46 bits physical, 48 bits virtual power management: [/shell]

CPUクレジット

CPU クレジット

CPUクレジットが30から始まって1時間に3づつ溜まってるのがわかります。

 ベンチマークとってみた

[shell] ======================================================================== BYTE UNIX Benchmarks (Version 5.1.3)   System: ip-172-31-4-4: GNU/Linux OS: GNU/Linux -- 4.1.10-17.31.amzn1.x86_64 -- #1 SMP Sat Oct 24 01:31:37 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-2676 v3 @ 2.40GHz (4800.1 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET 06:23:12 up 2:41, 2 users, load average: 0.14, 0.05, 0.05; runlevel 3 ------------------------------------------------------------------------ Benchmark Run: 金 12月 18 2015 06:23:12 - 06:51:14 1 CPU in system; running 1 parallel copy of tests</p> <p>Dhrystone 2 using register variables 34016448.6 lps (10.0 s, 7 samples) Double-Precision Whetstone 4221.1 MWIPS (9.8 s, 7 samples) Execl Throughput 6309.4 lps (30.0 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 1325281.6 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 352180.4 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 3948971.8 KBps (30.0 s, 2 samples) Pipe Throughput 2336300.0 lps (10.0 s, 7 samples) Pipe-based Context Switching 396745.0 lps (10.0 s, 7 samples) Process Creation 19061.5 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 7850.5 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 1076.2 lpm (60.0 s, 2 samples) System Call Overhead 4229803.6 lps (10.0 s, 7 samples)</p> <p>System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 34016448.6 2914.9 Double-Precision Whetstone 55.0 4221.1 767.5 Execl Throughput 43.0 6309.4 1467.3 File Copy 1024 bufsize 2000 maxblocks 3960.0 1325281.6 3346.7 File Copy 256 bufsize 500 maxblocks 1655.0 352180.4 2128.0 File Copy 4096 bufsize 8000 maxblocks 5800.0 3948971.8 6808.6 Pipe Throughput 12440.0 2336300.0 1878.1 Pipe-based Context Switching 4000.0 396745.0 991.9 Process Creation 126.0 19061.5 1512.8 Shell Scripts (1 concurrent) 42.4 7850.5 1851.5 Shell Scripts (8 concurrent) 6.0 1076.2 1793.6 System Call Overhead 15000.0 4229803.6 2819.9 ======== System Benchmarks Index Score 2004.2 [/shell]

バーストしてCPUクレジット数が減ってるのがわかる

バーストCPU

さらに2回走らせてクレジット消費しきった時のベンチマークもとりました。

[shell] ======================================================================== BYTE UNIX Benchmarks (Version 5.1.3)</p> <p> System: ip-172-31-4-4: GNU/Linux OS: GNU/Linux -- 4.1.10-17.31.amzn1.x86_64 -- #1 SMP Sat Oct 24 01:31:37 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-2676 v3 @ 2.40GHz (4800.1 bogomips) Hyper-Threading, x86-64, MMX, Physical Address Ext, SYSENTER/SYSEXIT, SYSCALL/SYSRET 07:55:01 up 4:13, 2 users, load average: 5.21, 3.33, 1.75; runlevel 3</p> <p>------------------------------------------------------------------------ Benchmark Run: 金 12月 18 2015 07:55:01 - 08:23:03 1 CPU in system; running 1 parallel copy of tests</p> <p>Dhrystone 2 using register variables 11616175.4 lps (10.0 s, 7 samples) Double-Precision Whetstone 400.2 MWIPS (10.0 s, 7 samples) Execl Throughput 577.8 lps (29.7 s, 2 samples) File Copy 1024 bufsize 2000 maxblocks 94584.6 KBps (30.0 s, 2 samples) File Copy 256 bufsize 500 maxblocks 24394.3 KBps (30.0 s, 2 samples) File Copy 4096 bufsize 8000 maxblocks 178686.1 KBps (30.0 s, 2 samples) Pipe Throughput 169258.3 lps (10.0 s, 7 samples) Pipe-based Context Switching 29084.1 lps (10.0 s, 7 samples) Process Creation 840.3 lps (30.0 s, 2 samples) Shell Scripts (1 concurrent) 505.3 lpm (60.0 s, 2 samples) Shell Scripts (8 concurrent) 65.2 lpm (60.3 s, 2 samples) System Call Overhead 207270.1 lps (10.0 s, 7 samples)</p> <p>System Benchmarks Index Values BASELINE RESULT INDEX Dhrystone 2 using register variables 116700.0 11616175.4 995.4 Double-Precision Whetstone 55.0 400.2 72.8 Execl Throughput 43.0 577.8 134.4 File Copy 1024 bufsize 2000 maxblocks 3960.0 94584.6 238.9 File Copy 256 bufsize 500 maxblocks 1655.0 24394.3 147.4 File Copy 4096 bufsize 8000 maxblocks 5800.0 178686.1 308.1 Pipe Throughput 12440.0 169258.3 136.1 Pipe-based Context Switching 4000.0 29084.1 72.7 Process Creation 126.0 840.3 66.7 Shell Scripts (1 concurrent) 42.4 505.3 119.2 Shell Scripts (8 concurrent) 6.0 65.2 108.6 System Call Overhead 15000.0 207270.1 138.2 ======== System Benchmarks Index Score 149.5 [/shell]

CPUクレジット使い切り

Scoreに10倍ほど差がつきました。

まとめ

t2.nanoはスモールスタートのサーバーに使えるかも。
あと、IoTとか(言いたいだけ)にも活用できそうでワクワク。

ラクスルではAWSを用いたサービス開発に興味のあるエンジニアを募集しております。

  • AWSを用いた大規模開発をしている方
  • AWSを用いた大規模インフラを見ている方
  • Uberみたいなことに興味のある方
  • 新しい事業を作り上げたい方

ラクスルではエンジニア・ディレクターを採用中です。
詳しくは、ラクスル採用ページ からお気軽にご連絡ください。