ASP.NET Core Pre-Benchmarking on Ubuntu using Docker

Authored by

This blog post is about yak shaving before starting learning how to do benchmarks of ASP.NET Core on Ubuntu using Docker for Windows.

Disclaimer : I am trying to learn how to do ASP.NET Core benchmarks using Docker. This could help developers to benchmark their Web Apps in order to improve their performance.
PS C:\Program Files\PowerShell\6.0.2> docker pull ubuntu:latest
latest: Pulling from library/ubuntu
22dc81ace0ea: Pull complete
1a8b3c87dba3: Pull complete
91390a1c435a: Pull complete
07844b14977e: Pull complete
b78396653dae: Pull complete
Digest: sha256:e348fbbea0e0a0e73ab0370de151e7800684445c509d46195aef73e090a49bd6
Status: Downloaded newer image for ubuntu:latest
PS C:\Program Files\PowerShell\6.0.2>
PS C:\Program Files\PowerShell\6.0.2> docker images
REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
ubuntu              latest              f975c5035748        3 weeks ago         112MB
PS C:\Program Files\PowerShell\6.0.2>
PS C:\Program Files\PowerShell\6.0.2> docker run -ti ubuntu:latest /bin/bash
root@7dec835ea6c9:/#
root@7dec835ea6c9:/# apt-get update
Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Get:4 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial/universe Sources [9802 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages [1558 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages [14.1 kB]
Get:8 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages [9827 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Sources [77.2 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [593 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial/multiverse amd64 Packages [176 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [12.7 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [427 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-updates/universe Sources [250 kB]
Get:15 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [962 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [13.1 kB]
Get:17 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [792 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [18.5 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [5153 B]
Get:20 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [7734 B]
Get:21 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [3492 B]
Fetched 25.1 MB in 3s (7891 kB/s)
Reading package lists... Done
root@7dec835ea6c9:/#
root@6a141e9ebf86:/# git clone https://github.com/aspnet/benchmarks.git
Cloning into 'benchmarks'...
remote: Counting objects: 3461, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 3461 (delta 2), reused 1 (delta 0), pack-reused 3451
Receiving objects: 100% (3461/3461), 1.12 MiB | 1.07 MiB/s, done.
Resolving deltas: 100% (2340/2340), done.
Checking connectivity... done.
root@6a141e9ebf86:/# ll
total 76
drwxr-xr-x   1 root root 4096 Jan 30 20:02 ./
drwxr-xr-x   1 root root 4096 Jan 30 20:02 ../
-rwxr-xr-x   1 root root    0 Jan 30 19:58 .dockerenv*
drwxr-xr-x   9 root root 4096 Jan 30 20:02 benchmarks/
drwxr-xr-x   1 root root 4096 Jan 30 20:02 bin/
drwxr-xr-x   2 root root 4096 Apr 12  2016 boot/
drwxr-xr-x   5 root root  360 Jan 30 19:58 dev/
drwxr-xr-x   1 root root 4096 Jan 30 20:02 etc/
drwxr-xr-x   2 root root 4096 Apr 12  2016 home/
drwxr-xr-x   1 root root 4096 Jan 30 20:02 lib/
drwxr-xr-x   2 root root 4096 Jan 23 22:49 lib64/
drwxr-xr-x   2 root root 4096 Jan 23 22:49 media/
drwxr-xr-x   2 root root 4096 Jan 23 22:49 mnt/
drwxr-xr-x   2 root root 4096 Jan 23 22:49 opt/
dr-xr-xr-x 129 root root    0 Jan 30 19:58 proc/
drwx------   2 root root 4096 Jan 23 22:49 root/
drwxr-xr-x   1 root root 4096 Jan 23 22:49 run/
drwxr-xr-x   1 root root 4096 Jan 30 20:02 sbin/
drwxr-xr-x   2 root root 4096 Jan 23 22:49 srv/
dr-xr-xr-x  13 root root    0 Jan 30 19:13 sys/
drwxrwxrwt   1 root root 4096 Jan 30 20:02 tmp/
drwxr-xr-x   1 root root 4096 Jan 23 22:49 usr/
drwxr-xr-x   1 root root 4096 Jan 23 22:49 var/
root@6a141e9ebf86:/#
root@6a141e9ebf86:/# cd benchmarks/
root@6a141e9ebf86:/benchmarks# ll
total 144
drwxr-xr-x 9 root root  4096 Jan 30 20:02 ./
drwxr-xr-x 1 root root  4096 Jan 30 20:02 ../
-rw-r--r-- 1 root root    27 Jan 30 20:02 .dockerignore
-rw-r--r-- 1 root root  1591 Jan 30 20:02 .editorconfig
drwxr-xr-x 8 root root  4096 Jan 30 20:02 .git/
-rw-r--r-- 1 root root   862 Jan 30 20:02 .gitattributes
-rw-r--r-- 1 root root  4781 Jan 30 20:02 .gitignore
-rw-r--r-- 1 root root   168 Jan 30 20:02 CONTRIBUTING.md
-rw-r--r-- 1 root root   991 Jan 30 20:02 Directory.Build.props
-rw-r--r-- 1 root root   410 Jan 30 20:02 Directory.Build.targets
-rw-r--r-- 1 root root   575 Jan 30 20:02 LICENSE.txt
-rw-r--r-- 1 root root   576 Jan 30 20:02 NuGet.Config
-rw-r--r-- 1 root root 12503 Jan 30 20:02 README.md
-rw-r--r-- 1 root root 13812 Jan 30 20:02 benchmarks.sln
drwxr-xr-x 2 root root  4096 Jan 30 20:02 build/
-rw-r--r-- 1 root root   260 Jan 30 20:02 build.cmd
-rwxr-xr-x 1 root root   253 Jan 30 20:02 build.sh*
drwxr-xr-x 8 root root  4096 Jan 30 20:02 docker/
drwxr-xr-x 3 root root  4096 Jan 30 20:02 experimental/
-rw-r--r-- 1 root root    83 Jan 30 20:02 korebuild-lock.txt
drwxr-xr-x 2 root root  4096 Jan 30 20:02 results/
-rw-r--r-- 1 root root   246 Jan 30 20:02 run.cmd
-rw-r--r-- 1 root root  6032 Jan 30 20:02 run.ps1
-rwxr-xr-x 1 root root  7317 Jan 30 20:02 run.sh*
drwxr-xr-x 2 root root  4096 Jan 30 20:02 scripts/
drwxr-xr-x 9 root root  4096 Jan 30 20:02 src/
-rw-r--r-- 1 root root   720 Jan 30 20:02 version.props
root@6a141e9ebf86:/benchmarks#
root@6a141e9ebf86:/benchmarks# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
root@6a141e9ebf86:/benchmarks#
root@6a141e9ebf86:/benchmarks# curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   983  100   983    0     0   4914      0 --:--:-- --:--:-- --:--:--  4915
root@6a141e9ebf86:/benchmarks# sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
root@6a141e9ebf86:/benchmarks# sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
root@6a141e9ebf86:/benchmarks# sudo apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 26.1 kB of archives.
After this operation, 215 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 apt-transport-https amd64 1.2.24 [26.1 kB]
Fetched 26.1 kB in 0s (235 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package apt-transport-https.
(Reading database ... 9592 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_1.2.24_amd64.deb ...
Unpacking apt-transport-https (1.2.24) ...
Setting up apt-transport-https (1.2.24) ...
root@6a141e9ebf86:/benchmarks#
root@6a141e9ebf86:/benchmarks# sudo apt-get update
Get:1 https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial InRelease [2846 B]
Hit:2 http://security.ubuntu.com/ubuntu xenial-security InRelease
Get:3 https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial/main amd64 Packages [24.9 kB]
Hit:4 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease
Fetched 27.7 kB in 3s (8346 B/s)
Reading package lists... Done
root@6a141e9ebf86:/benchmarks#

Authored by

Maher Jendoubi

Husband and Dad. Medical Imaging and Radiation Therapy Project Manager @GustaveRoussy 🏥. Microsoft @MVPAward 🏆 on Developer Technologies.

Subscribe to Maher Jendoubi

Get the latest posts delivered right to your inbox.

or subscribe via RSS with Feedly!
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.