Multi Service Bus Core on Raspberry Pi 3

RPI3_DOTNETC2Hi, today thanks to solution that I found on the Internet named Setting up Raspian and .NET Core 2.0 on Raspberry Pi I was able to configure .NET Core 2.0 and Multi Service Bus Core on the Raspberry Pi 3. This is a kind of PoC – Proof-of-Concept that makes possible to use on R Pi 3 for sensors for IoT my own service bus. The mentioned solution Multi Service Bus Core took me about 7 years to make, mostly because there was no .NET Core 2.0 idea when I started this solution. At the beginning I tired to make this solution portable for many languages, I am mean: C#, Java and C++, but the contributors I invited to the project were not able to help. That time I had very limited Java knowledge, but before I improved my Java skills .NET Core 2.0 appears and the magic happen ;-). And today on my R Pi3 I was able to execute the performance / integration tests of my solution, but before I show you the results I want to explain how to configure R Pi 3 on Rasbian without any GUI to run and execute .NET Core 2.0 code. To do so I run 4 commands on configured and upgraded R Pi 3 first. That 4 below shown commands are needed to install necessary packages, download .NET Core 2.0 runtime for ARM CPU, extract archive and make a symbolic link to the runtime.

sudo apt-get install curl libunwind8 gettext

curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Runtime/release/2.0.0/dotnet-runtime-latest-linux-arm.tar.gz

sudo mkdir -p /opt/dotnet && sudo tar zxf dotnet.tar.gz -C /opt/dotnet

sudo ln -s /opt/dotnet/dotnet /usr/local/bin

and then on the macbook I created Multi Service Bus Core perfromance tests publish ready for R Pi 3.

dotnet publish -c Release -r linux-arm MultiServiceBusCore.sln

and after that I copied from macbook to pi by using scp command (cp over ssh) and just before on R Pi 3 I run following command

mkdir MSBC_BIN

and then I copied files by running on my macbook

scp -p /Users/piotrsowa/Projects/MultiServiceBusCore/TestsPerformanceCore/bin/Release/netcoreapp2.0/linux-arm/publish/* pi@192.168.1.109:MSBC_BIN

and after that on R Pi 3 from folder MSBC_BIN I run

pi@raspberrypi:~/MSBC_BIN $ dotnet TestsPerformanceCore.dll 
Multi Service Bus Core Performance Tests
Asyncronously sending 7 * 50 000 messages (In-Proc): (1)Requester(msg1,msg2)->(1)Responder(msg1,msg2) and BACK…
Benchmark start 50 000 events: 790 milliseconds, 6329.1139 per second.
Benchmark start 50 000 events: 40 milliseconds, 125000 per second.
Benchmark start 50 000 events: 32 milliseconds, 156250 per second.
Benchmark start 50 000 events: 19 milliseconds, 263157.8947 per second.
Benchmark start 50 000 events: 20 milliseconds, 250000 per second.
Benchmark start 50 000 events: 16 milliseconds, 312500 per second.
Benchmark start 50 000 events: 18 milliseconds, 277777.7778 per second.
Disposing… done after 25 milliseconds.
PASS
Asyncronously sending 7 * 100 000 messages (In-Proc): (1)Requester(msg1,msg2)->(1)Receiver(msg1,msg2)->(1)Requester(msg3,msg4)->(1)Receiver(msg3,msg4)->(1)Requester(msg5)->(1)Receiver(msg5) and (2)BACK(msg2,msg4)…
Benchmark start 100 000 events: 1544 milliseconds, 64766.8394 per second.
Benchmark start 100 000 events: 1181 milliseconds, 84674.0051 per second.
Benchmark start 100 000 events: 854 milliseconds, 117096.0187 per second.
Benchmark start 100 000 events: 1001 milliseconds, 99900.0999 per second.
Benchmark start 100 000 events: 857 milliseconds, 116686.1144 per second.
Benchmark start 100 000 events: 977 milliseconds, 102354.1453 per second.
Benchmark start 100 000 events: 1017 milliseconds, 98328.4169 per second.
Disposing… done after 7 milliseconds.
PASS
Asyncronously sending 7 * 50 000 messages (In-Host): (1)Requester(msg1)->(1)Receiver(msg1) and NO BACK…
Benchmark start 50 000 events: 1158 milliseconds, 4317.7893 per second.
Benchmark start 50 000 events: 274 milliseconds, 18248.1752 per second.
Benchmark start 50 000 events: 311 milliseconds, 16077.1704 per second.
Benchmark start 50 000 events: 253 milliseconds, 19762.8458 per second.
Benchmark start 50 000 events: 296 milliseconds, 16891.8919 per second.
Benchmark start 50 000 events: 319 milliseconds, 15673.9812 per second.
Benchmark start 50 000 events: 317 milliseconds, 15772.8707 per second.
Disposing… done after 5035 milliseconds.
PASS
Asyncronously sending 7 * 50 000 messages (In-Host): (1)Requester(msg1,msg2)->(1)Responder(msg1,msg2) and BACK…
Benchmark start 50 000 events: 1911 milliseconds, 2616.4312 per second.
Benchmark start 50 000 events: 1917 milliseconds, 2608.242 per second.
Benchmark start 50 000 events: 2283 milliseconds, 2190.1007 per second.
Benchmark start 50 000 events: 2108 milliseconds, 2371.9165 per second.
Benchmark start 50 000 events: 2226 milliseconds, 2246.1815 per second.
Benchmark start 50 000 events: 1978 milliseconds, 2527.8059 per second.
Benchmark start 50 000 events: 1941 milliseconds, 2575.9918 per second.
Disposing… done after 5289 milliseconds.
PASS
Press any key to continue…

Thanks for reading,

p ;).

Leave a Reply

Your email address will not be published. Required fields are marked *

*