.NET Core on Google Cloud f1-micro instance

Given that .NET Core is capable of running on Linux, I decided to try running a simple Hello World test on Google Cloud Platform f1-micro instance and also ran OpenSSL speed tests.


I have been working on a hobby project written in .NET Core and will be hosting it on Google Cloud Platform VM eventually. Aside from the running simple Hello World example, considering I ran OpenSSL speed test on some of my Raspberry Pi 2, NAS and router, I wanted to know how much faster or slower the f1-micro is relative to them.

Installing .NET Core

I provisioned a f1-micro instance with Ubuntu Linux 16.04 LTS operating system on 10GB standard disk. You can pick whichever as long as it is supported by Microsoft.

I ran the instructions as per the guide on Microsoft page:

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
sudo apt-get update
sudo apt-get install dotnet-dev-1.0.1
dotnet new console -o hwapp
cd hwapp

The output of interest were:

Decompressing 100% 10518 ms
Expanding 100% 60763 ms
Content generation time: 733.5919 ms

Note: f1-micro is burstable. From Google Console, I observed a 200% spike in CPU usage. The same level of spikes were observed in subsequent benchmarks below.

In contrast, my Intel i7 Q740 laptop with SSD achieved the following which I am (quite certain) did not take advantage of multiple cores:

Decompressing 100% 8895 ms
Expanding 100% 57911 ms
Content generation time: 86.7835 ms

Interestingly, almost equal performance except the content generation time which was more disk intensive.

Running .NET Hello World and timing it

I ran the following on f1-micro:

dotnet restore
echo `date +%s%3N` && dotnet run && echo `date +%s%3N`

The output with numbers in miliseconds:

Hello World!

Roughly 2.4 seconds to run.

Then, I ran similar test on my laptop with the following output:

Hello World!

Roughly 2.2 seconds to run.

OpenSSL benchmark on f1-micro

I ran a few times. Below were the best observed.

RSA speed test with command line: openssl speed rsa


AES speed test with command line: openssl speed aes

AES-CBC16 bytes64 bytes256 bytes1024 bytes8192 bytes

See comparison against my other devices.

CPU usage of f1-micro

Google Cloud f1-micro CPU usage

As I mentioned earlier, f1-micro is burstable so take the performance numbers that I have reported above with a grain of salt. The bursts may come handy when you get short spikes in traffic.

OpenSSL benchmark on my laptop

In order to perform multi-core OpenSSL test, I had to use Windows Subsystem for Linux. The Windows OpenSSL binaries do not support multi-core speed test at time of writing this article.

RSA speed test with command line: openssl speed rsa -multi 4


Interestingly, my laptop was slower than the f1-micro for 1024-bit RSA sign/s test.

AES speed test with command line: openssl speed aes -multi 4

AES-CBC16 bytes64 bytes256 bytes1024 bytes8192 bytes


Provisioning a new f1-micro Linux machine on Google Cloud was very easy. Installation of .NET Core was very quick and OpenSSL benchmark numbers gave me a rough indication of its performance. I could develop applications on my laptop and force it to run on a single core to get a rough indicator of the f1-micro’s throughput.