geerlingguy / pi-cluster

Raspberry Pi Cluster automation
MIT License
454 stars 45 forks source link

Make this project work with Turing Pi RK1 boards #10

Closed geerlingguy closed 5 months ago

geerlingguy commented 7 months ago

See: #7

I would also like to make sure any other little incompatibilities are fixed up.

I could also rename the repo to sbc-cluster, maybe... but for now I like 'Pi Cluster' since the majority of my work is with Pi still.

geerlingguy commented 7 months ago

The above issue was already fixed in #8 — so this will just document any other issues I encounter!

geerlingguy commented 7 months ago

When fixing #11 I noticed Pi OS Bookworm's use of NetworkManager required some tweaks to the static networking playbook. I made those, and also fixed up some TODOs in there to support more than four nodes in a cluster :)

geerlingguy commented 5 months ago

The static networking playbook fails with:

TASK [Configure static IP address (Network Manager).] ***************************************************
fatal: [turing4.local]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"nmcli\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}
fatal: [turing3.local]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"nmcli\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}
fatal: [turing2.local]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"nmcli\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}
fatal: [turing1.local]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"nmcli\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"}

It looks like by default the server OS uses netplan, which I had never noticed before: https://askubuntu.com/q/1122757/88829

To switch to NetworkManager, modify the .yaml file inside /etc/netplan to read:

network:
  version: 2
  renderer: NetworkManager

Then run:

sudo netplan generate && sudo netplan apply && reboot

I'm adding a separate playbook that can be run to do this for you on all the nodes running Ubuntu.

geerlingguy commented 5 months ago

Works!

Screenshot 2024-04-23 at 3 57 22 PM
geerlingguy commented 5 months ago

Version 1.2.0 of this project should work fine with both Pi OS and Ubuntu, on Pis and other SBCs like the RK1.

geerlingguy commented 5 months ago

One more test—authenticated and anonymous requests to the Drupal site running on a Turing Pi 2 with 4x RK1 versus DeskPi Super6C running 6x Raspberry Pi CM4s (only one Drupal pod / instance, no scaling, so just measuring basic cluster performance).

DeskPi Super6C + 6x CM4:

Click to expand ``` Drupal benchmarks. Running wrk anonymous page load benchmark... Running 30s test @ http://10.0.2.61/ 4 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.43s 1.66s 9.85s 87.16% Req/Sec 21.41 13.79 100.00 78.42% 2364 requests in 30.06s, 83.26MB read Socket errors: connect 0, read 0, write 0, timeout 37 Requests/sec: 78.65 Transfer/sec: 2.77MB Running ab authenticated page load benchmark... This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 10.0.2.61 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Finished 700 requests Server Software: Apache/2.4.57 Server Hostname: 10.0.2.61 Server Port: 80 Document Path: / Document Length: 36382 bytes Concurrency Level: 10 Time taken for tests: 9.666 seconds Complete requests: 700 Failed requests: 0 Total transferred: 25783800 bytes HTML transferred: 25467400 bytes Requests per second: 72.42 [#/sec] (mean) Time per request: 138.084 [ms] (mean) Time per request: 13.808 [ms] (mean, across all concurrent requests) Transfer rate: 2604.98 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 0.3 1 5 Processing: 26 121 429.8 72 5137 Waiting: 25 119 429.7 70 5133 Total: 27 122 429.8 73 5138 Percentage of the requests served within a certain time (ms) 50% 73 66% 92 75% 103 80% 107 90% 133 95% 161 98% 316 99% 1064 100% 5138 (longest request) Drupal benchmark complete! ```

Turing Pi 2 + 4x RK1:

Click to expand ``` Drupal benchmarks. Running wrk anonymous page load benchmark... Running 30s test @ http://10.0.2.41/ 4 threads and 100 connections Thread Stats Avg Stdev Max +/- Stdev Latency 1.04s 799.56ms 6.19s 94.34% Req/Sec 31.37 24.10 120.00 71.59% 3135 requests in 30.06s, 110.47MB read Requests/sec: 104.30 Transfer/sec: 3.68MB Running ab authenticated page load benchmark... This is ApacheBench, Version 2.3 <$Revision: 1903618 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 10.0.2.41 (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Finished 700 requests Server Software: Apache/2.4.57 Server Hostname: 10.0.2.41 Server Port: 80 Document Path: / Document Length: 36404 bytes Concurrency Level: 10 Time taken for tests: 4.228 seconds Complete requests: 700 Failed requests: 0 Total transferred: 25798500 bytes HTML transferred: 25482800 bytes Requests per second: 165.55 [#/sec] (mean) Time per request: 60.404 [ms] (mean) Time per request: 6.040 [ms] (mean, across all concurrent requests) Transfer rate: 5958.37 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 1 0.3 1 5 Processing: 29 59 19.1 54 159 Waiting: 27 57 18.8 53 158 Total: 29 59 19.1 55 160 Percentage of the requests served within a certain time (ms) 50% 55 66% 63 75% 69 80% 73 90% 86 95% 99 98% 108 99% 122 100% 160 (longest request) Drupal benchmark complete! ```

Summarized:

Benchmark DeskPi Super 6C + CM4 Turing Pi 2 + RK1
wrk (anonymous) 78.65 104.30
ab (authenticated) 72.42 165.55