Table of Contents

Raspberry PI 5 as Server

https://browser.geekbench.com/v6/cpu/4184440 2.4Ghz
https://browser.geekbench.com/v6/cpu/4185322 2.8Ghz

Only HEVC/H265 8/10bit decoding supported (HDMI is HDR10 capable)

Storage Peformance

USB/SATA - VIA VL716 FW:85.43.1.8 UASP (raw read/write 578/212 MB/s)
SD Card Verbatim 64GB A1 V30 U3 (raw read/write 85/54 MB/s)

Proxmox 8.1 on Raspberry PI5

Debian 12 install
Check /etc/hosts and insert IP address for hostname!

sudo /bin/bash
curl https://global.mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg
echo "deb https://global.mirrors.apqa.cn/proxmox/debian/pve bookworm port">/etc/apt/sources.list.d/pveport.list
apt update && apt full-upgrade
apt install ifupdown2
apt install proxmox-ve postfix open-iscsi

Use RaspberryPI 4k pagesize kernel
add this line to /boot/config.txt

kernel=kernel8.img


Enable cgroups in /boot/cmdline.txt add kernel parameters

cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1

full ISO https://mirrors.apqa.cn/proxmox/isos/

Windows 11 ARM running under Proxmox

Edit network (add bridge and eth0 static config) Add DNS servers → system → DNS

Finish - you may reboot node!

Encryption

AES-128-CBC 2.23 GB/s @ 2.8Ghz
ChaCha20-Poly1305 821 MB/s @ 2.8Ghz

Commands

Show power stats

vcgencmd pmic_read_adc

Show temperature

vcgencmd measure_temp
vcgencmd get_throttled

Show frequency

lscpu

Overclocking

arm_freq=2800
over_voltage_delta=2000
temp_limit=80

4k pages instead 16k

F2FS unsuported on 16k

kernel=kernel8.img

Stress test

sudo apt install stress-ng
stress-ng --cpu 4 --cpu-method fft

Wifi Performance

221 Mbits/sec

Raspberry PI 4 as Server

CPU bugs

Spectre V1 & V2 and Variant 4 Speculative Store Bypass
CVE-2018-3640 CVE-2018-3639

You may disable mitigations in /boot/cmdline.txt

 mitigations=off

GPIO

RPi pinout

Basic Info

2x USB2.0 connected to VL805 (wire savings - USB3 wires not connected)
2x USB3.1 Gen 1 5Gbit - VL805 connected via PCIe 2.0 1x (5Gbit)
1x Gigabit Ethernet connected via PCIe 1.0 1x (2Gbit)
VideoCore VI running on ThreadX
Power approx 3-8Watts
iperf3 949Mbit/s

SAMBA Performance

912 Mbit/s = 114 MB/s read and write
ASM1352R FW:B5_20_60 UASP and vl805_fw_0137ab.bin (raw read/write 358/159 MB/s)

Raspbian Buster Lite

Encryption

ChaCha20-Poly1305 is fastest so it can be preferred (approx. 323 MB/s 2GHz)
AES-128-CBC max. 113 MB/s

ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305

config.txt

# For more options and information see
# http://rpf.io/configtxt
# Some settings may impact device functionality. See link above for details

arm_freq=1200
arm_freq_min=266
disable_splash=1
gpu_freq=100
gpu_freq_min=100
v3d_freq=100
gpu_mem=64
over_voltage=-1
temp_limit=80
arm_64bit=1

Overclock

Add some fan!

arm_freq=1750
over_voltage=2
-- or --
arm_freq=2000
over_voltage=5

SSH on headless mode

Insert empty file named “ssh” in /boot dir
Insert file named “userconf” in /boot dir with user:encryptedpass

echo 'mypassword' | openssl passwd -6 -stdin

SD Card care

Recommended SD card with MLC (Samsung Pro, SanDisk High Endurance, etc)

defaults,noatime,nodiratime,commit=1800

/etc/fstab (move most active locations to RAM)

tmpfs /tmp                      tmpfs    defaults,noatime,nosuid,size=100m   0 0
tmpfs /var/tmp                  tmpfs    defaults,noatime,nosuid,size=100m    0 0
tmpfs /var/log                  tmpfs    defaults,noatime,nosuid,mode=0755,size=100m  0 0
tmpfs /var/cache/minidlna       tmpfs    defaults,noatime,nosuid,size=128m    0 0
tmpfs /var/spool/mqueue         tmpfs    defaults,noatime,nosuid,mode=0700,gid=12,size=30m 0 0
tmpfs /var/lib/logrotate        tmpfs    defaults,noatime,nosuid,mode=0755,size=10m 0 0
tmpfs /var/lib/rrdcached        tmpfs    defaults,noatime,nosuid,mode=0755,size=10m 0 0
tmpfs /var/lib/samba            tmpfs    defaults,noatime,nosuid,mode=0755,size=10m 0 0
tmpfs /var/lib/nginx            tmpfs    defaults,noatime,nosuid,mode=0755,size=100m 0 0
tmpfs /var/lib/php/sessions     tmpfs    defaults,noatime,nosuid,mode=1733,size=10m 0 0
tmpfs /var/lib/systemd/timers   tmpfs    defaults,noatime,nosuid,mode=0755,size=1m 0 0
tmpfs /var/lib/systemd/timesync tmpfs    defaults,noatime,nosuid,mode=0755,uid=100,gid=102,size=1m 0 0

Create folders in RAM

create file /usr/lib/tmpfiles.d/ramdisk.conf

d /var/log/samba 0755 - - -
d /var/lib/rrdcached 0755 - - -
d /var/log/pveproxy 0755 33 33 -
d /var/log/exim4 0755 110 117 -
d /var/lib/samba/private 0755 - - -
d /var/lib/samba/usershares 1700 - - -
d /var/log/nginx 0755 - - -
d /var/log/mysql 0755 112 119 -

Remove fake hwclock

sudo apt-get remove fake-hwclock
sudo rm /etc/cron.hourly/fake-hwclock
sudo update-rc.d -f fake-hwclock remove
sudo rm /etc/init.d/fake-hwclock
sudo rm /etc/fake-hwclock.dat

Trim SD Card

sudo ionice -c 3 fstrim -v /

Disable smartd

If installed disable smartd

sudo systemctl disable smartmontools

Info about SD card
/sys/bus/mmc/devices/mmc0:0002

VCGENCMD

Check Temperature

vcgencmd measure_temp
vcgencmd measure_temp | awk '{ print substr($1,6,length($1)-9) }'

Check GPU Memory

vcgencmd get_mem gpu

Check Clock

vcgencmd measure_clock xxx

xxx = arm, core, h264, isp, v3d, uart, pwm, emmc, pixel, vec, hdmi, dpi

Check Voltage

vcgencmd measure_volts xxx

xxx = core, sdram_c, sdram_i, sdram_p

Other

vcgencmd bootloader_version
vcgencmd get_config int

Check time status

timedatectl status

SAMBA

More on SAMBA article for CentOS / RedHat

ffmpeg h264

ffmpeg -c:v h264_v4l2m2m -i input.mkv -pix_fmt yuv420p -s 1920x1080 -c:v h264_v4l2m2m -g 120 -b:v 20M output.mkv

h264 accelerated decode and encode sample

Power Save

##turn on/off wifi

dtoverlay=disable-wifi

Turn off HDMI / Headless

/usr/bin/tvservice -o

Status

/usr/bin/tvservice -s

sysctl

fs.inotify.max_user_watches=524288

HDD Care

Best stable settings are

USB Autosuspend 1 hour

Prevent external USB from 20s sleep by adding this into /boot/cmdline.txt

usbcore.autosuspend=3600

Change disk sleep 1 hour

sudo hdparm -S 241 /dev/sda

Install hd-idle

Download compiled deb package

https://janforman.org/files/Linux/hd-idle_1.05_armhf.deb

OR

sudo apt-get install build-essential fakeroot debhelper -y
wget https://janforman.org/files/Linux/hd-idle-1.05.tgz
tar -xvf hd-idle-1.05.tgz
cd hd-idle
dpkg-buildpackage -rfakeroot -uc -us
sudo dpkg -i ../hd-idle_*.deb

sudo nano /etc/default/hd-idle

HD_IDLE_OPTS="-i 0 -a sda -i 3600 -a sdb -i 3600"

Disable UASP for specific device

Insert device ids into /boot/firmware/cmdline.txt

usb-storage.quirks=152d:8561:u

Hack to permanently wakeup disk

Run this in background

while [ 1 ]
do
hdparm -C /dev/sda >/dev/null
sleep 120
done

Install general things

sudo apt install mc samba minidlna ffmpeg hostapd bridge-utils smartmontools

HostAP

sudo nano /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=janforman.com
hw_mode=a
channel=40
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Mount FS

sudo mount -t fs_type -o rw,lazytime,noatime,nodiratime,commit=600 device /path/to/dest/fs

Disable swap

sudo systemctl disable dphys-swapfile.service

Format external drive

mkfs.ext4 -b 4096 -i 131072 -I 128 /dev/sda1
tune2fs -i0 -c -1 /dev/sda1
tune2fs -o journal_data_writeback /dev/sda1
tune2fs -m 0 /dev/sda1

Revert RPI-UPDATE

sudo apt-get update; sudo apt-get install --reinstall raspberrypi-bootloader raspberrypi-kernel

Bootloader configuration

show

rpi-eeprom-config

edit

sudo -E rpi-eeprom-config --edit

shutdown

POWER_OFF_ON_HALT=1

disable HDMI for servers

DISABLE_HDMI=1