Skip to content

Commit 277d394

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

File tree

14 files changed

+571
-0
lines changed

14 files changed

+571
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Deploy 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 the Azure console and Ubuntu Pro 24.04 LTS as the base image.
10+
- Deploy the NGINX web server on the Azure Arm64 virtual machine running Ubuntu Pro 24.04 LTS.
11+
- Configure and test a static website using NGINX on the virtual machine.
12+
- Perform baseline testing and benchmarking of NGINX in the Ubuntu Pro 24.04 LTS Arm64 virtual machine environment.
13+
14+
15+
prerequisites:
16+
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
17+
- Familiarity with the [NGINX architecture](https://www.nginx.com/) and deployment practices on Arm64 platforms.
18+
- Network settings (firewalls and security groups) should allow inbound communication on ports 22 (SSH) and 80 (HTTP).
19+
20+
author: Jason Andrews
21+
22+
### Tags
23+
skilllevels: Advanced
24+
subjects: Web
25+
cloud_service_providers: Microsoft Azure
26+
27+
armips:
28+
- Neoverse
29+
30+
tools_software_languages:
31+
- NGINX
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: NGINX on Azure
48+
link: https://docs.nginx.com/nginx/deployment-guides/microsoft-azure/virtual-machines-for-nginx/
49+
type: documentation
50+
51+
52+
### FIXED, DO NOT MODIFY
53+
# ================================================================================
54+
weight: 1 # _index.md always has weight of 1 to order correctly
55+
layout: "learningpathall" # All files under learning paths have this same wrapper
56+
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
57+
---
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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
## NGINX
16+
17+
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.
18+
19+
There are three main variants of NGINX:
20+
- **NGINX Open Source**– Free and [open-source version available at nginx.org](https://nginx.org)
21+
- **NGINX Plus**- [Commercial edition of NGINX](https://www.nginx.com/products/nginx/) with features like dynamic reconfig, active health checks, and monitoring.
22+
- **NGINX Unit**- A lightweight, dynamic application server that complements NGINX. [Learn more at unit.nginx.org](https://unit.nginx.org/).
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
---
2+
title: NGINX Baseline Testing
3+
weight: 5
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 an **Ubuntu Pro 24.04 LTS** virtual machine 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 Ubuntu Pro</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 Ubuntu Pro 24.04 LTS!</h1>
59+
<p>Your static site is running beautifully on ARM64 </p>
60+
</div>
61+
</body>
62+
</html>
63+
```
64+
3. Move the Website to NGINX's Accessible Directory:
65+
66+
Since NGINX runs under the `www-data` user and may not have access to files inside `/home/ubuntu`, move the site to a directory where NGINX has permissions by default:
67+
68+
```console
69+
sudo mkdir -p /var/www/my-static-site
70+
sudo cp -r ~/my-static-site/* /var/www/my-static-site/
71+
sudo chown -R www-data:www-data /var/www/my-static-site
72+
```
73+
74+
4. Create NGINX Config File to Serve Static Website:
75+
76+
Point NGINX to serve your static HTML content.
77+
```console
78+
sudo nano /etc/nginx/conf.d/static-site.conf
79+
```
80+
Now, add the following configuration:
81+
82+
```NGINX
83+
server {
84+
listen 80;
85+
server_name localhost;
86+
87+
location / {
88+
root /var/www/my-static-site;
89+
index index.html;
90+
}
91+
92+
access_log /var/log/nginx/static-access.log;
93+
error_log /var/log/nginx/static-error.log;
94+
}
95+
```
96+
Make sure `/home/ubuntu/my-static-site` is the correct path to your **index.html**.
97+
98+
5. Test the NGINX Configuration:
99+
100+
```console
101+
sudo nginx -t
102+
```
103+
You should see an output similar to:
104+
```output
105+
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
106+
nginx: configuration file /etc/nginx/nginx.conf test is successful
107+
```
108+
109+
6. Reload or Restart NGINX:
110+
111+
Apply configuration changes and restart the web server.
112+
```console
113+
sudo nginx -s reload
114+
sudo systemctl restart nginx
115+
```
116+
117+
7. Test the Static Website on browser:
118+
119+
Access your website at your public IP on port 80.
120+
```console
121+
http://<your-vm-public-ip>/
122+
```
123+
Make sure port 80 is open in your Azure Network Security Group (NSG).
124+
125+
8. You should see the NGINX welcome page confirming a successful deployment:
126+
127+
![Static Website Screenshot](images/nginx-web.png)
128+
129+
This verifies the basic functionality of NGINX installation before proceeding to the benchmarking.
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
---
2+
title: NGINX Benchmarking
3+
weight: 6
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+
14+
1. Install ApacheBench
15+
16+
On **Ubuntu Pro 24.04 LTS**, ApacheBench is available as part of the `apache2-utils` package:
17+
```console
18+
sudo apt update
19+
sudo apt install apache2-utils -y
20+
```
21+
22+
2. Verify Installation
23+
24+
```console
25+
ab -V
26+
```
27+
You should see an output similar to:
28+
29+
```output
30+
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
31+
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
32+
Licensed to The Apache Software Foundation, http://www.apache.org/
33+
```
34+
35+
3. Basic Benchmark Command Syntax
36+
37+
```console
38+
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
39+
```
40+
Example:
41+
42+
```console
43+
ab -n 1000 -c 50 http://localhost/
44+
```
45+
This sends **1000 total requests** with **50 concurrent connections** to `http://localhost/`.
46+
47+
You should see an output similar to:
48+
```output
49+
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
50+
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
51+
Licensed to The Apache Software Foundation, http://www.apache.org/
52+
53+
Benchmarking localhost (be patient)
54+
Completed 100 requests
55+
Completed 200 requests
56+
Completed 300 requests
57+
Completed 400 requests
58+
Completed 500 requests
59+
Completed 600 requests
60+
Completed 700 requests
61+
Completed 800 requests
62+
Completed 900 requests
63+
Completed 1000 requests
64+
Finished 1000 requests
65+
66+
67+
Server Software: nginx/1.24.0
68+
Server Hostname: localhost
69+
Server Port: 80
70+
71+
Document Path: /
72+
Document Length: 890 bytes
73+
74+
Concurrency Level: 50
75+
Time taken for tests: 0.032 seconds
76+
Complete requests: 1000
77+
Failed requests: 0
78+
Total transferred: 1132000 bytes
79+
HTML transferred: 890000 bytes
80+
Requests per second: 31523.86 [#/sec] (mean)
81+
Time per request: 1.586 [ms] (mean)
82+
Time per request: 0.032 [ms] (mean, across all concurrent requests)
83+
Transfer rate: 34848.65 [Kbytes/sec] received
84+
85+
Connection Times (ms)
86+
min mean[+/-sd] median max
87+
Connect: 0 1 0.1 1 1
88+
Processing: 0 1 0.1 1 1
89+
Waiting: 0 1 0.2 1 1
90+
Total: 1 2 0.1 2 2
91+
92+
Percentage of the requests served within a certain time (ms)
93+
50% 2
94+
66% 2
95+
75% 2
96+
80% 2
97+
90% 2
98+
95% 2
99+
98% 2
100+
99% 2
101+
100% 2 (longest request)
102+
```
103+
104+
### Benchmark Results Table Explained:
105+
106+
- **Requests per second** – How many requests were served per second.
107+
- **Time per request** – Average latency per request.
108+
- **Transfer rate** – Data throughput.
109+
- **Connection times** – Breakdown of min/mean/max connect, processing, and total times.
110+
- **Percentage served** – Percentile distribution of response times.
111+
112+
### Benchmark summary on x86_64:
113+
Here is a summary of the benchmark results collected on x86_64 **D4s_v6 Ubuntu Pro 24.04 LTS virtual machine**.
114+
115+
| **Category** | **Metric** | **Value** |
116+
|---------------------------|-------------------------------------------------|-------------------------------|
117+
| **General Info** | Server Software | nginx/1.24.0 |
118+
| | Server Hostname | localhost |
119+
| | Server Port | 80 |
120+
| | Document Path | / |
121+
| | Document Length | 615 bytes |
122+
| **Test Setup** | Concurrency Level | 50 |
123+
| | Time Taken for Tests | 0.038 sec |
124+
| | Complete Requests | 1000 |
125+
| | Failed Requests | 0 |
126+
| **Transfer Stats** | Total Transferred | 857,000 bytes |
127+
| | HTML Transferred | 615,000 bytes |
128+
| | Requests per Second | 26,592.21 [#/sec] |
129+
| | Time per Request (mean) | 1.880 ms |
130+
| | Time per Request (across all) | 0.038 ms |
131+
| | Transfer Rate | 22,255.39 KB/sec |
132+
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
133+
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 2 |
134+
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
135+
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.2 / 2 / 2 |
136+
| **Latency Percentiles** | 50% of requests served within | 2 ms |
137+
| | 66% of requests served within | 2 ms |
138+
| | 75% of requests served within | 2 ms |
139+
| | 80% of requests served within | 2 ms |
140+
| | 90% of requests served within | 2 ms |
141+
| | 95% of requests served within | 2 ms |
142+
| | 98% of requests served within | 2 ms
143+
144+
### Benchmark summary on Arm64:
145+
Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pro 24.04 LTS virtual machine**.
146+
147+
| **Category** | **Metric** | **Value** |
148+
|---------------------------|-------------------------------------------------|-------------------------------|
149+
| **General Info** | Server Software | nginx/1.24.0 |
150+
| | Server Hostname | localhost |
151+
| | Server Port | 80 |
152+
| | Document Path | / |
153+
| | Document Length | 890 bytes |
154+
| **Test Setup** | Concurrency Level | 50 |
155+
| | Time Taken for Tests | 0.032 sec |
156+
| | Complete Requests | 1000 |
157+
| | Failed Requests | 0 |
158+
| **Transfer Stats** | Total Transferred | 1,132,000 bytes |
159+
| | HTML Transferred | 890,000 bytes |
160+
| | Requests per Second | 31,523.86 [#/sec] |
161+
| | Time per Request (mean) | 1.586 ms |
162+
| | Time per Request (across all) | 0.032 ms |
163+
| | Transfer Rate | 34,848.65 KB/sec |
164+
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
165+
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
166+
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
167+
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 |
168+
169+
### Highlights from Ubuntu Pro 24.04 LTS Arm64 Benchmarking
170+
171+
When comparing the results on Arm64 vs x86_64 virtual machines:
172+
173+
- Achieved **31,523.86 requests/sec**, demonstrating high throughput under concurrent load.
174+
- Response time per request averaged **1.586 ms**, indicating efficient handling of requests with minimal delay.
175+
- **Zero failed requests**, confirming stability and reliability during testing.
176+
- Consistently low **connection and processing times** (mean ≈ 1 ms), ensuring smooth performance.
177+
178+
You have now benchmarked NGINX on an Azure Cobalt 100 Arm64 virtual machine and compared results with x86_64.

0 commit comments

Comments
 (0)