Raspberry Pi 4 Model Bのサンプルを見たり、ベンチマークした結果を紹介していきます。なお、日本での認証(技適)が未取得であるため、以前Raspberry Pi 3 Model B+をベンチマークする際にも利用させていただいた、スイッチサイエンス様のシールドボックスをお借りしました。
おことわり: サンプルボードの検証結果は製品版と一部結果が異なる場合があります。
■外観のチェック
表面。
SoC型番はBCM2711となっています。Raspberry Pi 3B+と同じく表面は金属となりました。
電源ポートとmicroHDMIポート。
USB/LANポート。LANポートの位置が右に移動している点が今までのRaspberry Piとの違いです。真ん中はUSB3.0ポートです。
裏面
USBポートはVIA VL805チップから提供されます。また、GbEポート用のBCM54213PEチップが搭載されています。
■スペックの確認
CPUの情報
pi@four:~ $ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 3 (v7l)
BogoMIPS : 108.00
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
(processor1〜3略)
Hardware : BCM2835
Revision : c03111
Serial : (略)
メモリーの情報。サンプルは4GB RAMモデルのため、MemTotalの数値もそのとおりになっています。
pi@four:~ $ cat /proc/meminfo
MemTotal: 4003816 kB
MemFree: 3566036 kB
MemAvailable: 3714744 kB
USBポートはPCI Express接続のVIA VL805 USB3.0コントローラーによる提供のため、lspciコマンドで確認できます。
pi@four:~ $ lspci
00:00.0 PCI bridge: Broadcom Limited Device 2711 (rev 10)
01:00.0 USB controller: VIA Technologies, Inc. VL805 USB 3.0 Host Controller (rev 01)
■ギガビットは本当?iperfでテスト
Raspberry Pi 4 Model BとNanoPi Neo 2を使用してiPerf3を実行しました。NanoPi Neo 2はギガビットの速度が出る別のシングルボードコンピュータです。
それぞれのボードとギガビットイーサネットのハブをシールドボックスに入れて、同じくハブに接続したUSB Ethernetアダプターでボックスの外の端末からアクセスして計測します。
Nano Pi Neo 2をiperf3サーバーとして実行した様子です。940Mbpsの速度が出ていることがわかりました。
pi@four:~ $ iperf3 -c 192.168.2.4
Connecting to host 192.168.2.4, port 5201
[ 5] local 192.168.2.5 port 54272 connected to 192.168.2.4 port 5201
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 112 MBytes 940 Mbits/sec 0 317 KBytes
[ 5] 1.00-2.00 sec 112 MBytes 943 Mbits/sec 0 376 KBytes
[ 5] 2.00-3.00 sec 112 MBytes 938 Mbits/sec 0 376 KBytes
[ 5] 3.00-4.00 sec 112 MBytes 940 Mbits/sec 0 434 KBytes
[ 5] 4.00-5.00 sec 112 MBytes 942 Mbits/sec 0 434 KBytes
[ 5] 5.00-6.00 sec 112 MBytes 938 Mbits/sec 0 434 KBytes
[ 5] 6.00-7.00 sec 112 MBytes 939 Mbits/sec 0 434 KBytes
[ 5] 7.00-8.00 sec 112 MBytes 944 Mbits/sec 0 452 KBytes
[ 5] 8.00-9.00 sec 112 MBytes 940 Mbits/sec 0 452 KBytes
[ 5] 9.00-10.00 sec 112 MBytes 941 Mbits/sec 0 598 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate Retr
[ 5] 0.00-10.00 sec 1.10 GBytes 941 Mbits/sec 0 sender
[ 5] 0.00-10.00 sec 1.09 GBytes 940 Mbits/sec receiver
iperf Done.
Raspberry Pi 4をiperf3サーバーとして実行した様子です。やや速度が遅くなりますが837Mbpsという高速な結果になりました。
pi@four:~ $ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.2.4, port 42350
[ 5] local 192.168.2.5 port 5201 connected to 192.168.2.4 port 42352
[ ID] Interval Transfer Bitrate
[ 5] 0.00-1.00 sec 96.0 MBytes 805 Mbits/sec
[ 5] 1.00-2.00 sec 100 MBytes 841 Mbits/sec
[ 5] 2.00-3.00 sec 100 MBytes 842 Mbits/sec
[ 5] 3.00-4.00 sec 100 MBytes 841 Mbits/sec
[ 5] 4.00-5.00 sec 100 MBytes 841 Mbits/sec
[ 5] 5.00-6.00 sec 100 MBytes 842 Mbits/sec
[ 5] 6.00-7.00 sec 100 MBytes 842 Mbits/sec
[ 5] 7.00-8.00 sec 100 MBytes 841 Mbits/sec
[ 5] 8.00-9.00 sec 100 MBytes 841 Mbits/sec
[ 5] 9.00-10.00 sec 99.1 MBytes 832 Mbits/sec
[ 5] 10.00-10.03 sec 3.00 MBytes 843 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval Transfer Bitrate
[ 5] 0.00-10.03 sec 1001 MBytes 837 Mbits/sec receiver
■USB3.0のベンチマーク
USB3.0のベンチマークを、高速なUSB3.0メモリを使ってhdparmコマンドで取得しました。
取得時に電力が不足したためか、エラー出力が見られましたが、結果は87MB/sと高速な値を見ることができました。
pi@four:~ $ sudo hdparm -t /dev/sda
/dev/sda:
SG_IO: bad/missing sense data, sb[]: 70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Timing buffered disk reads: 262 MB in 3.01 seconds = 87.12 MB/sec
■Unixbench
最後に恒例のUnixbenchです。
========================================================================
BYTE UNIX Benchmarks (Version 5.1.3)
System: raspberrypi: GNU/Linux
OS: GNU/Linux -- 4.19.50-v7l+ -- #895 SMP Thu Jun 20 16:03:42 BST 2019
Machine: armv7l (unknown)
Language: en_US.utf8 (charmap="ANSI_X3.4-1968", collate="ANSI_X3.4-1968")
CPU 0: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)
CPU 1: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)
CPU 2: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)
CPU 3: ARMv7 Processor rev 3 (v7l) (0.0 bogomips)
23:47:23 up 4:57, 2 users, load average: 0.00, 0.66, 2.72; runlevel Jun
------------------------------------------------------------------------
Benchmark Run: Sun Jun 23 2019 23:47:23 - 00:15:36
4 CPUs in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 10010557.0 lps (10.0 s, 7 samples)
Double-Precision Whetstone 2381.7 MWIPS (9.6 s, 7 samples)
Execl Throughput 911.8 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 111140.1 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 30981.9 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 301680.2 KBps (30.0 s, 2 samples)
Pipe Throughput 160911.4 lps (10.0 s, 7 samples)
Pipe-based Context Switching 48233.4 lps (10.0 s, 7 samples)
Process Creation 1856.0 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 2466.3 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 736.8 lpm (60.1 s, 2 samples)
System Call Overhead 493135.1 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 10010557.0 857.8
Double-Precision Whetstone 55.0 2381.7 433.0
Execl Throughput 43.0 911.8 212.1
File Copy 1024 bufsize 2000 maxblocks 3960.0 111140.1 280.7
File Copy 256 bufsize 500 maxblocks 1655.0 30981.9 187.2
File Copy 4096 bufsize 8000 maxblocks 5800.0 301680.2 520.1
Pipe Throughput 12440.0 160911.4 129.3
Pipe-based Context Switching 4000.0 48233.4 120.6
Process Creation 126.0 1856.0 147.3
Shell Scripts (1 concurrent) 42.4 2466.3 581.7
Shell Scripts (8 concurrent) 6.0 736.8 1227.9
System Call Overhead 15000.0 493135.1 328.8
========
System Benchmarks Index Score 320.2
------------------------------------------------------------------------
Benchmark Run: Mon Jun 24 2019 00:15:36 - 00:43:47
4 CPUs in system; running 4 parallel copies of tests
Dhrystone 2 using register variables 40088657.2 lps (10.0 s, 7 samples)
Double-Precision Whetstone 9528.0 MWIPS (9.6 s, 7 samples)
Execl Throughput 2702.4 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 213778.4 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 59398.3 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 569815.6 KBps (30.0 s, 2 samples)
Pipe Throughput 607729.5 lps (10.0 s, 7 samples)
Pipe-based Context Switching 193837.7 lps (10.0 s, 7 samples)
Process Creation 4612.8 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 5911.6 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 804.6 lpm (60.2 s, 2 samples)
System Call Overhead 1875987.0 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 40088657.2 3435.2
Double-Precision Whetstone 55.0 9528.0 1732.4
Execl Throughput 43.0 2702.4 628.5
File Copy 1024 bufsize 2000 maxblocks 3960.0 213778.4 539.8
File Copy 256 bufsize 500 maxblocks 1655.0 59398.3 358.9
File Copy 4096 bufsize 8000 maxblocks 5800.0 569815.6 982.4
Pipe Throughput 12440.0 607729.5 488.5
Pipe-based Context Switching 4000.0 193837.7 484.6
Process Creation 126.0 4612.8 366.1
Shell Scripts (1 concurrent) 42.4 5911.6 1394.2
Shell Scripts (8 concurrent) 6.0 804.6 1340.9
System Call Overhead 15000.0 1875987.0 1250.7
========
System Benchmarks Index Score 851.0
以下は同じバージョンのRaspbianを使用してRaspberry Pi 3B+上で実行した結果です。
------------------------------------------------------------------------
Benchmark Run: Mon Jun 24 2019 05:08:05 - 05:36:16
4 CPUs in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 5296678.9 lps (10.0 s, 7 samples)
Double-Precision Whetstone 1431.2 MWIPS (9.8 s, 7 samples)
Execl Throughput 960.5 lps (29.8 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 138696.1 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 42914.1 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 357533.0 KBps (30.0 s, 2 samples)
Pipe Throughput 298836.5 lps (10.0 s, 7 samples)
Pipe-based Context Switching 53689.7 lps (10.0 s, 7 samples)
Process Creation 2345.4 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 1913.1 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 584.4 lpm (60.1 s, 2 samples)
System Call Overhead 687496.7 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 5296678.9 453.9
Double-Precision Whetstone 55.0 1431.2 260.2
Execl Throughput 43.0 960.5 223.4
File Copy 1024 bufsize 2000 maxblocks 3960.0 138696.1 350.2
File Copy 256 bufsize 500 maxblocks 1655.0 42914.1 259.3
File Copy 4096 bufsize 8000 maxblocks 5800.0 357533.0 616.4
Pipe Throughput 12440.0 298836.5 240.2
Pipe-based Context Switching 4000.0 53689.7 134.2
Process Creation 126.0 2345.4 186.1
Shell Scripts (1 concurrent) 42.4 1913.1 451.2
Shell Scripts (8 concurrent) 6.0 584.4 974.0
System Call Overhead 15000.0 687496.7 458.3
========
System Benchmarks Index Score 331.9
------------------------------------------------------------------------
Benchmark Run: Mon Jun 24 2019 05:36:16 - 06:04:42
4 CPUs in system; running 4 parallel copies of tests
Dhrystone 2 using register variables 18740948.4 lps (10.0 s, 7 samples)
Double-Precision Whetstone 5363.6 MWIPS (10.6 s, 7 samples)
Execl Throughput 2069.3 lps (29.9 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 220388.7 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 62487.0 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 589552.1 KBps (30.0 s, 2 samples)
Pipe Throughput 1075015.8 lps (10.0 s, 7 samples)
Pipe-based Context Switching 189588.0 lps (10.0 s, 7 samples)
Process Creation 4393.8 lps (30.0 s, 2 samples)
Shell Scripts (1 concurrent) 4339.6 lpm (60.0 s, 2 samples)
Shell Scripts (8 concurrent) 590.4 lpm (60.3 s, 2 samples)
System Call Overhead 2489812.0 lps (10.0 s, 7 samples)
System Benchmarks Index Values BASELINE RESULT INDEX
Dhrystone 2 using register variables 116700.0 18740948.4 1605.9
Double-Precision Whetstone 55.0 5363.6 975.2
Execl Throughput 43.0 2069.3 481.2
File Copy 1024 bufsize 2000 maxblocks 3960.0 220388.7 556.5
File Copy 256 bufsize 500 maxblocks 1655.0 62487.0 377.6
File Copy 4096 bufsize 8000 maxblocks 5800.0 589552.1 1016.5
Pipe Throughput 12440.0 1075015.8 864.2
Pipe-based Context Switching 4000.0 189588.0 474.0
Process Creation 126.0 4393.8 348.7
Shell Scripts (1 concurrent) 42.4 4339.6 1023.5
Shell Scripts (8 concurrent) 6.0 590.4 983.9
System Call Overhead 15000.0 2489812.0 1659.9
========
System Benchmarks Index Score 762.2
1 parallel copy of testsでは若干Raspberry Pi 4Bが低い値となりましたが、4 parallel copy of testsの結果はRaspberry Pi 4BがRaspberry Pi 3B+よりも約100ほどスコアが高くなっていました。