Skip to content

Commit d586600

Browse files
committed
Deploy Nginx on the Microsoft Azure Cobalt 100 processors
Signed-off-by: odidev <[email protected]>
1 parent c4ae2b4 commit d586600

File tree

15 files changed

+594
-0
lines changed

15 files changed

+594
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Run Nginx on the Microsoft Azure Cobalt 100 processors
3+
4+
minutes_to_complete: 30
5+
6+
who_is_this_for: This Learning Path introduces Nginx deployment on Microsoft Azure Cobalt 100 (Arm-based) virtual machine. It is intended for system administrators and developers looking to deploy and benchmark Nginx on Arm architecture with minimal adjustments from traditional x86_64 environments.
7+
8+
learning_objectives:
9+
- Start an Azure Arm64 virtual machine using Azure console and Ubuntu as the base image.
10+
- Learn how to create an Azure Linux 3.0 Docker container.
11+
- Deploy the Nginx web server on an Azure Linux 3.0 Arm64-based Docker container and an Azure Linux 3.0 custom-image-based Azure virtual machine.
12+
- Test and Benchmark Nginx in both the containerized and virtual machine environments.
13+
14+
prerequisites:
15+
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
16+
- A machine with [Docker](/install-guides/docker/) installed.
17+
- Network settings (firewalls and security groups) should allow inbound communication on ports 22 (SSH) and 80 (HTTP).
18+
19+
author: Jason Andrews
20+
21+
### Tags
22+
skilllevels: Advanced
23+
subjects: Web
24+
cloud_service_providers: Microsoft Azure
25+
26+
armips:
27+
- Neoverse
28+
29+
tools_software_languages:
30+
- Nginx
31+
- Docker
32+
- Apache Bench
33+
34+
operatingsystems:
35+
- Linux
36+
37+
further_reading:
38+
- resource:
39+
title: Nginx official documentation
40+
link: https://nginx.org/en/docs/
41+
type: documentation
42+
- resource:
43+
title: Apache Bench official documentation
44+
link: https://httpd.apache.org/docs/2.4/programs/ab.html
45+
type: documentation
46+
- resource:
47+
title: Docker overview
48+
link: https://docs.docker.com/get-started/overview/
49+
type: documentation
50+
- resource:
51+
title: Nginx on Azure
52+
link: https://docs.nginx.com/nginx/deployment-guides/microsoft-azure/virtual-machines-for-nginx/
53+
type: documentation
54+
55+
56+
### FIXED, DO NOT MODIFY
57+
# ================================================================================
58+
weight: 1 # _index.md always has weight of 1 to order correctly
59+
layout: "learningpathall" # All files under learning paths have this same wrapper
60+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
61+
---
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# ================================================================================
3+
# FIXED, DO NOT MODIFY THIS FILE
4+
# ================================================================================
5+
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
6+
title: "Next Steps" # Always the same, html page title.
7+
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
8+
---
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: "Overview"
3+
4+
weight: 2
5+
6+
layout: "learningpathall"
7+
---
8+
9+
## Cobalt 100 Arm-based processor
10+
11+
Azure’s Cobalt 100 is built on Microsoft's first-generation, in-house Arm-based processor: the Cobalt 100. Designed entirely by Microsoft and based on Arm’s Neoverse N2 architecture, this 64-bit CPU delivers improved performance and energy efficiency across a broad spectrum of cloud-native, scale-out Linux workloads. These include web and application servers, data analytics, open-source databases, caching systems, and more. Running at 3.4 GHz, the Cobalt 100 processor allocates a dedicated physical core for each vCPU, ensuring consistent and predictable performance.
12+
13+
To learn more about Cobalt 100, refer to the blog [Announcing the preview of new Azure virtual machine based on the Azure Cobalt 100 processor](https://techcommunity.microsoft.com/blog/azurecompute/announcing-the-preview-of-new-azure-vms-based-on-the-azure-cobalt-100-processor/4146353).
14+
15+
## Azure Linux 3.0
16+
17+
Azure Linux 3.0 is Microsoft's in-house, lightweight Linux distribution optimized for running cloud-native workloads on Azure. Designed with performance, security, and reliability in mind, it is fully supported by Microsoft and tailored for containers, microservices, and Kubernetes. With native support for Arm64 (AArch64) architecture, Azure Linux 3.0 enables efficient execution of workloads on energy-efficient Arm-based infrastructure, making it a powerful choice for scalable and cost-effective cloud deployments.
18+
19+
## Nginx
20+
21+
Nginx is a high-performance, open-source web server, reverse proxy, load balancer, and HTTP cache. Originally developed by Igor Sysoev, Nginx is known for its event-driven, asynchronous architecture, which enables it to handle high concurrency with low resource usage.
22+
23+
There are three main variants of Nginx:
24+
- **Nginx Open Source**– Free and [open-source version available at nginx.org](https://nginx.org)
25+
- **Nginx Plus**- [Commercial edition of Nginx](https://www.nginx.com/products/nginx/) with features like dynamic reconfig, active health checks, and monitoring.
26+
- **Nginx Unit**- A lightweight, dynamic application server that complements Nginx. [Learn more at unit.nginx.org](https://unit.nginx.org/).
27+
28+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
title: Nginx Baseline Testing
3+
weight: 6
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
10+
### Baseline testing with a static website on Nginx
11+
Perform baseline testing of Nginx on Azure Linux 3.0 by deploying a custom static HTML page. This verifies that Nginx is correctly serving content on the Arm64 platform.
12+
13+
1. Create a Static Website Directory:
14+
15+
Prepare a folder to host your HTML content.
16+
```console
17+
mkdir -p ~/my-static-site
18+
```
19+
2. Create an HTML file and Web page:
20+
21+
Create a HTML file `nano my-static-site/index.html` with the content below to design a visually appealing static landing page.
22+
23+
```html
24+
<!DOCTYPE html>
25+
<html lang="en">
26+
<head>
27+
<meta charset="UTF-8">
28+
<title>Welcome to NGINX on Azure Linux</title>
29+
<style>
30+
body {
31+
background: linear-gradient(to right, #4facfe, #00f2fe);
32+
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
33+
display: flex;
34+
justify-content: center;
35+
align-items: center;
36+
height: 100vh;
37+
margin: 0;
38+
color: white;
39+
text-align: center;
40+
}
41+
.box {
42+
background: rgba(0, 0, 0, 0.3);
43+
padding: 40px;
44+
border-radius: 12px;
45+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
46+
}
47+
h1 {
48+
margin-bottom: 10px;
49+
font-size: 2.5rem;
50+
}
51+
p {
52+
font-size: 1.2rem;
53+
}
54+
</style>
55+
</head>
56+
<body>
57+
<div class="box">
58+
<h1> Welcome to NGINX on Azure Linux 3.0!</h1>
59+
<p>Your static site is running beautifully on ARM64 </p>
60+
</div>
61+
</body>
62+
</html>
63+
```
64+
3. Create NGINX Config File to Serve Static Website:
65+
66+
Point Nginx to serve your static HTML content.
67+
```console
68+
sudo nano /etc/nginx/conf.d/static-site.conf
69+
```
70+
Now, add the following configuration:
71+
72+
```nginx
73+
server {
74+
listen 80;
75+
server_name localhost;
76+
77+
location / {
78+
root /home/azureuser/my-static-site;
79+
index index.html;
80+
}
81+
82+
access_log /var/log/nginx/static-access.log;
83+
error_log /var/log/nginx/static-error.log;
84+
}
85+
```
86+
Make sure `/home/azureuser/my-static-site` is the correct path to your **index.html**.
87+
88+
4. Test the Nginx Configuration:
89+
90+
```console
91+
sudo nginx -t
92+
```
93+
You should see an output similar to:
94+
```output
95+
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
96+
nginx: configuration file /etc/nginx/nginx.conf test is successful
97+
```
98+
99+
5. Reload or Restart Nginx:
100+
101+
Apply configuration changes and restart the web server.
102+
```console
103+
sudo nginx -s reload
104+
sudo systemctl restart nginx
105+
```
106+
107+
6. Test the Static Website on browser:
108+
109+
Access your website at your public IP on port 80.
110+
```console
111+
http://<your-vm-public-ip>/
112+
```
113+
Make sure port 80 is open in your Azure Network Security Group (NSG).
114+
115+
7. You should see the Nginx welcome page confirming a successful deployment:
116+
117+
![Static Website Screenshot](images/web-page.png)
118+
119+
This verifies the basic functionality of Nginx installation before proceeding to the benchmarking.
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
title: Nginx Benchmarking
3+
weight: 7
4+
5+
### FIXED, DO NOT MODIFY
6+
layout: learningpathall
7+
---
8+
9+
## Nginx Benchmarking by ApacheBench
10+
11+
**ApacheBench (ab)** is a lightweight command-line tool for benchmarking HTTP servers. It measures performance metrics like requests per second, response time, and throughput under concurrent load.
12+
13+
1. Install ApacheBench
14+
15+
```console
16+
sudo dnf install httpd-tools
17+
```
18+
19+
2. Verify Installation
20+
21+
```console
22+
ab -V
23+
```
24+
You should see an output similar to:
25+
26+
```output
27+
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
28+
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
29+
Licensed to The Apache Software Foundation, http://www.apache.org/
30+
```
31+
32+
3. Basic Benchmark Command Syntax
33+
34+
```console
35+
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
36+
```
37+
Example:
38+
39+
```console
40+
ab -n 1000 -c 50 http://localhost/
41+
```
42+
This sends **1000 total requests** with **50 concurrent connections** to `http://localhost/`.
43+
44+
You should see an output similar to:
45+
```output
46+
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
47+
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
48+
Licensed to The Apache Software Foundation, http://www.apache.org/
49+
50+
Benchmarking localhost (be patient)
51+
Completed 100 requests
52+
Completed 200 requests
53+
Completed 300 requests
54+
Completed 400 requests
55+
Completed 500 requests
56+
Completed 600 requests
57+
Completed 700 requests
58+
Completed 800 requests
59+
Completed 900 requests
60+
Completed 1000 requests
61+
Finished 1000 requests
62+
63+
64+
Server Software: nginx/1.25.4
65+
Server Hostname: localhost
66+
Server Port: 80
67+
68+
Document Path: /
69+
Document Length: 615 bytes
70+
71+
Concurrency Level: 50
72+
Time taken for tests: 0.049 seconds
73+
Complete requests: 1000
74+
Failed requests: 0
75+
Total transferred: 848000 bytes
76+
HTML transferred: 615000 bytes
77+
Requests per second: 20352.51 [#/sec] (mean)
78+
Time per request: 2.457 [ms] (mean)
79+
Time per request: 0.049 [ms] (mean, across all concurrent requests)
80+
Transfer rate: 16854.42 [Kbytes/sec] received
81+
82+
Connection Times (ms)
83+
min mean[+/-sd] median max
84+
Connect: 0 1 0.2 1 2
85+
Processing: 0 1 0.2 1 2
86+
Waiting: 0 1 0.3 1 2
87+
Total: 1 2 0.1 2 3
88+
89+
Percentage of the requests served within a certain time (ms)
90+
50% 2
91+
66% 2
92+
75% 2
93+
80% 2
94+
90% 2
95+
95% 3
96+
98% 3
97+
99% 3
98+
100% 3 (longest request)
99+
```
100+
101+
### Benchmark Results Table Explained:
102+
103+
- **Requests per second** – How many requests were served per second.
104+
- **Time per request** – Average latency per request.
105+
- **Transfer rate** – Data throughput.
106+
- **Connection times** – Breakdown of min/mean/max connect, processing, and total times.
107+
- **Percentage served** – Percentile distribution of response times.
108+
109+
### Benchmark summary on x86_64:
110+
111+
The following benchmark results are collected on two different x86_64 environments: a **Docker container running Azure Linux 3.0 hosted on a D4s_v6 Ubuntu-based Azure virtual machine**, and a **D4s_v4 Azure virtual machine created from the Azure Linux 3.0 image published by Ntegral Inc**.
112+
113+
| **Category** | **Metric** | **Value on Virtual Machine** | **Value on Docker** |
114+
| ------------------------- | ---------------------------------------------- | ------------------- | ------------------- |
115+
| **General Info** | Server Software | nginx/1.25.4 | nginx/1.25.4 |
116+
| | Server Hostname | localhost | localhost |
117+
| | Server Port | 80 | 80 |
118+
| | Document Path | / | / |
119+
| | Document Length | 615 bytes | 615 bytes |
120+
| **Test Setup** | Concurrency Level | 50 | 50 |
121+
| | Time Taken for Tests | 0.049 sec | 0.027 sec |
122+
| | Complete Requests | 1000 | 1000 |
123+
| | Failed Requests | 0 | 0 |
124+
| **Transfer Stats** | Total Transferred | 848000 bytes | 848000 bytes |
125+
| | HTML Transferred | 615000 bytes | 615000 bytes |
126+
| | Requests per Second | 20,352.51 [#/sec] | 37,510.78 [#/sec] |
127+
| | Time per Request (mean) | 2.457 ms | 1.333 ms |
128+
| | Time per Request (across all) | 0.049 ms | 0.027 ms |
129+
| | Transfer Rate | 16,854.42 KB/sec | 31,063.62 KB/sec |
130+
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 2 | 0 / 0 / 0.1 / 0 / 1 |
131+
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 2 | 0 / 1 / 0.2 / 1 / 1 |
132+
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.3 / 1 / 2 | 0 / 1 / 0.2 / 1 / 1 |
133+
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 3 | 1 / 1 / 0.1 / 1 / 2 |
134+
135+
136+
### Benchmark summary on Arm64:
137+
138+
The following benchmark results are collected on two different Arm64 environments: a **Docker container running Azure Linux 3.0 hosted on a D4ps_v6 Ubuntu-based Azure virtual machine**, and a **D4ps_v6 Azure virtual machine created from the Azure Linux 3.0 custom image using the AArch64 ISO**.
139+
140+
| **Category** | **Metric** | **Value on Virtual Machine** | **Value on Docker** |
141+
|---------------------------|--------------------------------------------------|--------------------------|---------------------------|
142+
| **General Info** | Server Software | nginx/1.25.4 | nginx/1.25.4 |
143+
| | Server Hostname | localhost | localhost |
144+
| | Server Port | 80 | 80 |
145+
| | Document Path | / | / |
146+
| | Document Length | 615 bytes | 615 bytes |
147+
| **Test Setup** | Concurrency Level | 50 | 50 |
148+
| | Time Taken for Tests | 0.032 sec | 0.025 sec |
149+
| | Complete Requests | 1000 | 1000 |
150+
| | Failed Requests | 0 | 0 |
151+
| **Transfer Stats** | Total Transferred | 848000 bytes | 848000 bytes |
152+
| | HTML Transferred | 615000 bytes | 615000 bytes |
153+
| | Requests per Second | 30,876.59 [#/sec] | 40,698.38 [#/sec] |
154+
| | Time per Request (mean) | 1.619 ms | 1.229 ms |
155+
| | Time per Request (across all) | 0.032 ms | 0.025 ms |
156+
| | Transfer Rate | 25,569.67 KB/sec | 33,703.35 KB/sec |
157+
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 | 0 / 0 / 0.1 / 0 / 1 |
158+
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 2 | 0 / 1 / 0.1 / 1 / 1 |
159+
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 | 0 / 1 / 0.1 / 1 / 1 |
160+
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 | 1 / 1 / 0.1 / 1 / 1 |
161+
162+
163+
### Highlights from Azure Linux Arm64 Benchmarking
164+
165+
- Achieved **30,876.59 requests/sec**, significantly outperforming x86_64 (20,352.51 requests/sec).
166+
- Response time per request averaged **1.619 ms**, indicating high efficiency under 50 concurrent connections.
167+
- **Zero failed requests**, ensuring full stability during the stress test.
168+
- Consistently low **connection and processing times** (mean ≈ 1 ms).

0 commit comments

Comments
 (0)