A low power 1U Raspberry Pi cluster server for inexpensive colocation.

Overview

Raspberry Pi 1U Server

There are server colocation providers that allow hosting a 1U server for as low as $30/month, but there's a catch: There are restrictions on power usage (1A @ 120v max, for example) because they're expecting small and power-efficient network equipment like firewalls.

This repo is about designing a server that fits within the 1U space and 1A @ 120v power constraint while maximizing computing power, storage, and value.

raspberry pi 1u server - inside raspberry pi 1u server - front raspberry pi 1u server - back

Table of contents

Colocation Providers

  • $30/month - Turnkey Internet
    • 1 Amp @ 120V
    • 1 Usable IP (+$10 for 5 usable IPs)
    • 10 Mbit Ethernet
    • 3 TB Monthly Transfer
  • $40/month - Nextarray
    • 100Mbps Unmetered
    • 1 Amps 120V
    • 3 Usable IPs (+$13 for 11 usable IPs)
    • GigE Port
    • 1.5Tbps Protection
    • Location: Dallas, TX
  • $50/month - Joe’s Datacenter
    • 5 Usable IPs
    • Bandwidth: 33TB on 1Gbps Port
    • Power: Up To 2 Amps 120V (Single Power Connection)
    • Network Connection: Single Network Cable
    • Location: Kansas City, MO

Parts

Specs Summary

  • 20x 1.5GHz CPU cores
  • 16GB LPDDR4-3200 SDRAM
  • 1.2TB SSD Storage
  • Gigabit Ethernet

Total cost: ~$800

1U Chassis

Storage

Storage Enclosure

Switch

Single Board Computer

Raspberry Pi Case

  • 5x $12.99 - Geekworm Raspberry Pi 4 Armor Case
    • Allows access to GPIO pins, which will be necessary for the Pi wired to the relay for remote power management.
    • Uses less space than the Flirc case, which makes it difficult to close the chassis lid.
    • Reviews: 1

Power

Remote Power Management

Other Wiring

Power Usage

  • Raspberry Pi 4 + SSD:
    • idle: 2.2W, 0.44A @ 5V (0.018A @ 120v)
    • load: 4.2W, 0.84A @ 5V (0.035A @ 120v)
  • Total w/ blower fan on low setting:
    • idle: 36-38.4W, 0.30-32A @ 120V
    • load: 43.2W, 0.36A @ 120V
  • Total w/ blower fan on high setting:
    • idle: 48W, 0.4A @ 120V

Software Setup

You will need to do this for each of the Raspberry Pi's:

  1. Flash an SD card with Raspbian Lite (under "Raspberry Pi OS (other)" in the Raspberry Pi Imager) and enable SSH with:
    1. cd /Volumes/boot/
    2. touch ssh
  2. Insert the SD card into the Pi, power on, and ssh into the Pi with ssh pi@ and the password "raspberry".
  3. Update the hostname to correspond to the number on the case:
    1. sudo raspi-config
    2. 1 System Options -> S4 Hostname -> Update hostname -> Finish -> Reboot
  4. Update the firmware on the Pi to allow booting from USB:
    1. sudo apt-get update && sudo apt full-upgrade -y
    2. sudo rpi-update (only do this once on each Pi)
  5. Disable HDMI to save power: sudo sed -i -e '$i \/usr/bin/tvservice -o\n' /etc/rc.local
  6. Disable wifi and bluetooth:
    1. sudo bash -c 'echo -e "dtoverlay=pi3-disable-wifi" >> /boot/config.txt'
    2. sudo bash -c 'echo -e "dtoverlay=pi3-disable-bt" >> /boot/config.txt'
    3. sudo reboot
  7. Add your public key (while disconnected from the pi, with cat ~/.ssh/id_rsa.pub | ssh pi@ 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys')
  8. Make sure the SSD is plugged into one of the blue USB 3 ports.
  9. SSH into the Pi again and Disable password authentication:
    1. sudo sed -i '/^#*PubkeyAuthentication /c PubkeyAuthentication yes' /etc/ssh/sshd_config
    2. sudo sed -i '/^#*ChallengeResponseAuthentication /c ChallengeResponseAuthentication no' /etc/ssh/sshd_config
    3. sudo sed -i '/^#*PasswordAuthentication /c PasswordAuthentication no' /etc/ssh/sshd_config
    4. sudo sed -i '/^#*UsePAM /c UsePAM no' /etc/ssh/sshd_config
  10. Configure the Pi to prioritize booting from the SSD:
    1. sudo raspi-config
    2. 6 Advanced Options -> A6 Boot Order -> B2 USB Boot -> Finish -> Reboot
    3. If you see an "No EEPROM bin file found" error, you may need to run sudo -E rpi-eeprom-config --edit and add [all] BOOT_ORDER=0xf14.
  11. Repeat the steps above (without sudo rpi-update) with the new OS on the SSD. SSH'ing into the new OS on the SSD may require clearing out the line with the corresponding IP in your ~/.ssh/known_hosts file with ssh-keygen -R .

Hardware Setup

  1. Remove the hard drive bay dividers and front panel extension cable from the inside of the chassis.

    remove chassis dividers

  2. Install the Raspberry Pi's into their cases.

    install raspberry pi into geekworm case

  3. Install the M.2 drives into their enclosures.

  4. Insert a SD card into each of the Pi's.

  5. Follow the Software Setup guide if you haven't already.

  6. Add mounting tape to the bottom of each of the SSD enclosures and attach them to the top of the Raspberry Pi's.

    add mounting tape to ssd

  7. Add mounting tape to the bottom of the raspberry pi cases. Don't remove the bottom cover of the mounting tape adhesive yet.

    add mounting tape to raspberry pi

  8. Remove the rubber feet from the bottom of the networking switch and replace with 4x small squares of mounting tape. Don't remove the bottom cover of the mounting tape adhesive yet.

  9. Add labels with numbers to the tops of the cases. These numbers will correspond to the hostnames of the Pi's in the software setup.

    raspberry pi numbering

  10. Use wire cutters to remove the metal adjacent to the ethernet port and mount the port side of the ethernet extension to the back of the chassis with washers and the included bolts.

    installing ethernet port 1

    installing ethernet port 2

  11. Cut a section of the plastic sheet that came with the chassis (for under the motherboard) to fit under the power supply breakout board.

  12. Drill holes in the chassis, insert nylon standoffs, and add the plastic sheet.

    installing atx breakout board 1

    installing atx breakout board 2

    installing atx breakout board 3

    installing atx breakout board 4

    installing atx breakout board 5

    installing atx breakout board 6

  13. Cut 5x 6" lengths of red standed wire, strip the both ends, and install one end of each wire into the "+" slots of the USB terminal blocks and the other side of each wire into the 5V terminals of the ATX power supply breakout board. Make sure the 20 pin power supply has a corresponding wire, some wires will be missing and may not actually work on the power breakout board.

    cutting wire for atx breakout board

    add usb connectors to atx breakout board

  14. Cut and strip 5x 6" lengths of green standed wires then install one end of the each wire into the "-" slots of the USB terminal blocks and the other side of each wire into the COM terminals on the ATX power supply breakout board. Again, ensure the wire exists on the 20 pin cable before using the terminal block.

  15. Mount the ATX power supply breakout board to the chassis and secure with nylon nuts. Insert the 20 pin ATX power supply connector into the ATX power supply breakout board.

    installing atx breakout board 7

  16. Remove the covers from the mounting tape adhesive on the bottom of the Pi cases and switch, then position them in the chassis. You will probably want to try to match the layout from the finished project above, but this may change depending on how many Raspberry Pi's you have.

  17. Attach ethernet cables from each of the Raspberry Pi's to the networking switch.

  18. Cut the 12V barrel connector along with 12" of wire off of the power adapter for the network switch. Attach the cable with the solid white line markings into a 12V terminal on the ATX breakout board and attach the other wire to a COM terminal on the breakout board. You may want to confirm this is the correct "+" wire for your switch with an ohm meter and the diagram near the power connector the back of the switch.

    network switch positive negative

  19. Cut a section of the plastic sheet that came with the chassis (for under the motherboard) to fit under the 8 channel relay board.

    cut piece of plastic to fit under relay

  20. Drill holes in the chassis, install nylon standoffs, and add the section of plastic sheet.

    installing relay 1

  21. Wire 4 of the 5 5V USB terminal "+" wires from the ATX breakout board to NC terminals on the 8 channel relay, and wire the other side of the relay to the "+" on the USB terminal block for 4 of the 5 Pi's. More relay setup instructions

  22. Mount the 8 channel relay to the chassis with the nylon standoffs and secure with nylon nuts.

    installing relay 2

  23. Cut a section of the plastic sheet that came with the chassis (for under the motherboard) to fit under the 1 channel relay board.

  24. Drill holes in the chassis and install nylon standoffs for the 1 channel relay.

    installing 1 ch relay part 1

    installing 1 ch relay part 2

  25. Wire DC+ on the relay to a 3.3V GPIO pin from a Pi that is powered by the 8 channel relay. DC- will need to be wired to a ground GPIO pin and IN will need to be wired to GPIO pin 18. Finally, wire the 5V power from the ATX breakout board to NC, and wire COM to the "+" on the terminal block for the Pi isn't powered by the 8 channel relay.

    installing 1 ch relay part 3

  26. Mount the 1 channel relay to the chassis with the nylon standoffs and secure with nylon nuts.

    installing 1 ch relay part 4

  27. Move the jumper on the 1 channel relay from H to L.

  28. Plug one of ATX SATA power connectors into the fan controller and connect the blower fan from the chassis into the fan controller.

  29. Drill a hole in the front of the case for the power switch and install the power switch.

    power switch installed

  30. Add a 290 ohm resistor inline with a 6" length of wire with a female header on one side, add heatshrink, then strip the side opposite of the female header and install the wire into a 3.3V terminal on the ATX power supply breakout board.

    add resistor to front panel wire 1

    add resistor to front panel wire 2

    wire front panel LED to the atx breakout board

  31. Add the stripped side of another wire of the same length with a female header on one side to a COM terminal on the power supply breakout board, then put the female headers onto the pins of one of the LEDs on the front panel.

    wire front panel LED to the atx breakout board

  32. Apply electrical tape over the unused header pins and terminal blocks to prevent accidental electrical shorts.

  33. Connect the Pi's USB C ports to the USB terminal adapters.

  34. Plug in the power and flip the power switch to "on".

Network Setup

  1. Get the static IPs, subnet, and gateway from the colocation provider.
  2. Edit /etc/dhcpcd.conf on each of the Pis and add the networking info from the colocation provider, for example:
    interface eth0
    static ip_address=192.168.1.191/24
    static routers=192.168.1.1
    static domain_name_servers=8.8.8.8 8.8.4.4
    
  3. sudo reboot

Remote Power Management Software

Only do this on the power management Paspberry Pi connected to the relay:

  1. curl -o relay_control.py https://raw.githubusercontent.com/pawl/raspberry-pi-1u-server/main/relay_control.py
  2. Test the script: python relay_control.py

You should see the light on the SSD flash off and on for the Pi whose relay's GPIO pin you entered.

Measuring Amperage

  1. Plug the server into the Kill-A-Watt.
  2. Press the button on the Kill-A-Watt for "amps".
  3. sudo apt-get install stress
  4. while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& stress -c 4 -t 900s
  5. Restart the server by unplugging and plugging back in. Watch the amperage on start-up.

Single Points Of Failure

  • Switch
  • Relay
  • Power Supply
  • Electrical Short (from loose terminal or pinched wire?)
  • The Management Pi Dies (and can't powercycle most of the other Pi's)

How Many More Pi's Will Fit?

At least 7. (including 1 Pi Zero and a Pi 3b)

7 raspberry pis in 1u server

Cloud Comparisons

This is a tough comparison to make because the Pi CPU cores are only 1.5GHz per core.

AWS

  • T2.micro - $9.50/month for 1GB Ram & 1 CPU @ 2.5 GHz * 20 = $190/month
  • T2.medium - $38.00/month for 4GB Ram & 2 CPU @ 2.5 GHz * 10 = $380/month

The T2 instances have a limited number of CPU credits, which means they can't run at 100% all the time like the Pi can.

Digital Ocean

$20/month for 4GB Ram & 2 vCPUs @ 2.5 GHz * 10 = $200/month

Physical Server Comparisons

Dell R620

  • Form Factor: 1U
  • Power Consumption: 250W (not peak?) @ 120V = 2.08333A
  • Cost: $585
  • Specs:
    • 2x E5-2630 V2 2.6Ghz = 12 cores
    • 64GB RAM
    • 4x 900GB SAS

Dell R710

  • Form Factor: 2U
  • Power Consumption: 160W (not at peak?) @ 120V = 1.33333A
  • Cost: $688
  • Specs:
    • 2x E5649 2.53GHz = 12 cores
    • 64GB RAM
    • 16TB 4x 4TB

HoneyComb LX2

  • Form Factor: 1U
  • Power Consumption: 40W
  • Cost: $750 + ($100 chassis, $250 RAM, $250 Hard Drives) = $1350
  • Specs:
    • 16 2.2 GHz cores
    • 64GB RAM
    • 16TB 4x 4TB

2x M1 Mac Minis

  • Note: This will require running MacOS until full linux support.
  • Form Factor: 1U
  • Power Consumption: 80W (peak)
  • Cost: ($700 * 2) + $100 chassis = $1500
  • Specs:
    • 16 3.2 GHz cores (insanely fast compared to Pis)
    • 16GB RAM
    • 512GB SSD Storage

Ideas For V2

  • Add fuses and spade connectors inline with the devices to reduce the severity of an electical short.

Other Colocation Options

Other Chassis Options

Other Single Board Computer Options

Other Case Options

  • No case, drill holes for stand-offs, and mount to the chassis.
    • More work, but would probably work fine and small heatsinks would be cheap.
  • Argon ONE M.2 Case for Raspberry Pi 4
    • Includes an M.2 storage adapter.

Other Storage Options

Note: I tried using 2.5" SSDs with inateck enclosures and there wasn't enough room.

Other Power Options

Other Power Switch Options

Similar Projects

You might also like...
Raspberry Pi Spectrometer
Raspberry Pi Spectrometer

PySpectrometer 2021-03-05 Raspberry Pi Spectrometer The PySpectrometer is a Python (OpenCV and Tkinter) implementation of an optical spectrometer. The

A global contest to grow and monitor your own food with Raspberry Pi
A global contest to grow and monitor your own food with Raspberry Pi

growlab A global contest to grow and monitor your own food with Raspberry Pi A capture from phototimer of my seed tray with a wide-angle camera positi

A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.
A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler.

Env-MCRO A Raspberry Pi Pico powered Macro board, like a Streamdeck but cheaper and simpler. (btw this image is a bit outdated, some of the silkscreen

A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

A Macropad using the Raspberry Pi Pico, programmed with CircuitPython.

Raspberry Pi Pico and LoRaWAN from CircuitPython
Raspberry Pi Pico and LoRaWAN from CircuitPython

Raspberry Pi Pico and LoRaWAN from CircuitPython Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040-based board using CircuitPython

a weather application for the raspberry pi and the Pimorioni Inky pHAT.
a weather application for the raspberry pi and the Pimorioni Inky pHAT.

raspi-weather a weather application for the raspberry pi and the Inky pHAT

A versatile program that uses the raspberry pi camera and provides it as a service
A versatile program that uses the raspberry pi camera and provides it as a service

PiCameleon Is a daemon program meant to provide the RaspberryPi Camera as a service while running according to a configuration.

Monorepo for my Raspberry Pi dashboard and GPS satellite listener.
Monorepo for my Raspberry Pi dashboard and GPS satellite listener.

🥧 pi dashboard My blog post: Listening to Satellites with my Raspberry Pi This is the monorepo for my Raspberry Pi dashboard!

A Raspberry Pi Pico plant sensor hub coded in Micropython

plantsensor A Raspberry Pi Pico plant sensor hub coded in Micropython I used: 1x Raspberry Pi Pico - microcontroller 1x Waveshare Pico OLED 1.3 - scre

Comments
  • Don't promote ugreen

    Don't promote ugreen

    Ugreen is an extremely problematic company you do not want to promote.

    For example, https://www.amazon.ca/dp/B088FHJLR1/ claims "UL certified" but if you review the image gallery posted by real owners you can see there's no UL mark. On the other hand there is a TÜV Sud mark which is fake . https://www.tuvsud.com/en/services/product-certification/ps-cert You can search for yourself -- either for ugreen which doesn't turn up this product or for the product number 70773 which turns up nothing relevant. Also note how the only USB IF certified products under ugreen are two cables in total. https://usb.org/products

    They are very good at gaming the system and that's why I advocate at every possible point furthering their agenda. https://www.fakespot.com/company/ugreen/ they survived the recent Amazon purge because their Fakespot rating is "only" C. They build a very good word-of-mouth marketing machine now you are part of -- and don't want to be.

    There are any number of better companies out there with similar or better product: Sabrent, Anker, Plugable...

    opened by chx 1
  • Comparison based on GHz flawed

    Comparison based on GHz flawed

    Hi, great project. Really enjoyed the write-up.

    One minor bug bear. Raspberry pis are vastly less powerful than even atom line intel processors.

    The xeons AWS are backed by even in VPS (time sharing) are much more compute dense than a pi. Same with DigitalOcean. Even cost per-watt I'm not sure the pi wins if scaled for MIPS, FLOPS or memory throughput.

    You wouldn't need 10 VPS to deal with compute or memory load of 10 pi4's.

    opened by Lewiscowles1986 2
Owner
Paul Brown
Paul Brown
A script that publishes power usage data of iDrac enabled servers to an MQTT broker for integration into automation and power monitoring systems

iDracPowerMonitorMQTT This script publishes iDrac power draw data for iDrac 6 enabled servers to an MQTT broker. This can be used to integrate the pow

Lucas Zanchetta 10 Oct 6, 2022
🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7

rpi-backlight A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display. Note: This GIF was created using the

Linus Groh 238 Jan 8, 2023
Create a low powered, renewable generation forecast display with a Raspberry Pi Zero & Inky wHAT.

GB Renewable Forecast Display This Raspberry Pi powered eInk display aims to give you a quick way to time your home energy usage to help balance the g

Andy Brace 32 Jul 2, 2022
CO2Ampel - This RaspberryPi project uses weather data to estimate the share of renewable energy in the power grid

CO2Ampel This RaspberryPi project uses weather data to estimate the share of ren

Felix 4 Jan 19, 2022
a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico

pico_ws2812b a library for using WS2812b leds (aka neopixels) with Raspberry Pi Pico You'll first need to save the ws2812b.py file to your device (for

null 76 Nov 25, 2022
Micro Displays for Raspberry Pi

micro-displays Micro Displays for Raspberry Pi Why? I'm super bored in lockdown. Add a Raspberry Pi 400 and a few tiny displays... The top half of the

ig 291 Jul 6, 2022
A Python class for controlling the Pimoroni RGB Keypad for Raspberry Pi Pico

rgbkeypad A Python class for controlling the Pimoroni RGB Keypad for the Raspberry Pi Pico. Compatible with MicroPython and CircuitPython. keypad = RG

Martin O'Hanlon 43 Nov 11, 2022
Raspberry Pi Pico development platform for PlatformIO

Raspberry Pi Pico development platform for PlatformIO A few words in the beginning Before experimental please Reinstall the platform Version: 1.0.0 Th

Georgi Angelov 160 Dec 23, 2022
Raspberry Pi Pico support for VS Code

Pico-Go VS Code Extension Pico-Go provides code auto-completion and allows you to communicate with your Raspberry Pi Pico board using the built-in REP

Chris Wood 114 Dec 28, 2022
Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi

Clean Dashboard for Pi-Hole Minimal and clean dashboard to visualize some stats of Pi-Hole with an E-Ink display attached to your Raspberry Pi.

Alessio Santoru 104 Dec 14, 2022