RasPiを少しでも速くしたい

RasPi3は、最高1.2GHzで動作します。
RasPi3B+は、最高1.4GHzで動作するそうです。
いや、遅くはないんですよ。ぜんぜん、ぜんぜん、RasPi3で大丈夫。

それでも、少しでも早くしたいじゃないですか？で/boot/config.txtを開いて

```
pi@raspberry:~ $ sudo vi /boot/config.txt
```

下の方に足します。

```
arm_freq=1200
core_freq=500
sdram_freq=500
over_voltage=6
```

arm_freq=1300を設定しても動きますが、長時間の動作はきついようなので1200で止めときましょう。

後、CPUの動作速度を確認できるコマンドがあります。
まずは、インストール。

```
pi@raspberrypi:~ $ sudo apt-get install cpufrequtils
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libcpufreq0
The following NEW packages will be installed:
  cpufrequtils libcpufreq0
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/53.5 kB of archives.
After this operation, 274 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Preconfiguring packages ...
Selecting previously unselected package libcpufreq0.
(Reading database ... 31539 files and directories currently installed.)
Preparing to unpack .../libcpufreq0_008-1_armhf.deb ...
Unpacking libcpufreq0 (008-1) ...
Selecting previously unselected package cpufrequtils.
Preparing to unpack .../cpufrequtils_008-1_armhf.deb ...
Unpacking cpufrequtils (008-1) ...
Processing triggers for man-db (2.7.5-1~bpo8+1) ...
Processing triggers for systemd (215-17+deb8u7) ...
Setting up libcpufreq0 (008-1) ...
Setting up cpufrequtils (008-1) ...
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults
Processing triggers for libc-bin (2.19-18+deb8u10) ...
pi@raspberrypi:~ $
```

確認は

```
pi@raspberrypi:~ $ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: BCM2835 CPUFreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 355 us.
  hardware limits: 600 MHz - 1.20 GHz
  available frequency steps: 600 MHz, 1.20 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.20 GHz.
                  The governor "ondemand" may decide which speed to use
                  within this range.
  current CPU frequency is 600 MHz.
  cpufreq stats: 600 MHz:94.48%, 1.20 GHz:5.52%  (12)
analyzing CPU 1:
  driver: BCM2835 CPUFreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
(以下略)
```
設定は

```
pi@raspberrypi:~ $ sudo cpufreq-set -g performance
pi@raspberrypi:~ $
```
とすると

```
pi@raspberrypi:~ $ cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: BCM2835 CPUFreq
  CPUs which run at the same hardware frequency: 0 1 2 3
  CPUs which need to have their frequency coordinated by software: 0 1 2 3
  maximum transition latency: 355 us.
  hardware limits: 600 MHz - 1.20 GHz
  available frequency steps: 600 MHz, 1.20 GHz
  available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
  current policy: frequency should be within 600 MHz and 1.20 GHz.
                  The governor "performance" may decide which speed to use
                  within this range.
  current CPU frequency is 1.20 GHz.
  cpufreq stats: 600 MHz:81.67%, 1.20 GHz:18.33%  (13)
analyzing CPU 1:
  driver: BCM2835 CPUFreq
  CPUs which run at the same hardware frequency: 0 1 2 3
(以下略)
```
current CPU frequency のところが1.20GHzに変わります。

長時間1.2GHzで動作させる場合は、CPUにはヒートシンクの張り付けと、自然冷却では間に合わないので、小型の扇風機などで強制冷却をしましょう。

あと、決まり文句ですが、自己責任でお願いします。
重要なのでもう一回。自己責任でお願いします。


参考にさせていただいたのはコチラ
Poor and Junk
https://dbpro.xyz/1400

raspberrypi.org
https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md

raspberrypi.org
https://www.raspberrypi.org/forums/viewtopic.php?t=138123