Skip to content

Deploy Nginx on the Microsoft Azure Cobalt 100 processors #2208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Run Nginx on the Microsoft Azure Cobalt 100 processors

minutes_to_complete: 30

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.

learning_objectives:
- Start an Azure Arm64 virtual machine using Azure console and Ubuntu as the base image.
- Learn how to create an Azure Linux 3.0 Docker container.
- 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.
- Test and Benchmark Nginx in both the containerized and virtual machine environments.

prerequisites:
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
- A machine with [Docker](/install-guides/docker/) installed.
- Network settings (firewalls and security groups) should allow inbound communication on ports 22 (SSH) and 80 (HTTP).

author: Jason Andrews

### Tags
skilllevels: Advanced
subjects: Web
cloud_service_providers: Microsoft Azure

armips:
- Neoverse

tools_software_languages:
- Nginx
- Docker
- Apache Bench

operatingsystems:
- Linux

further_reading:
- resource:
title: Nginx official documentation
link: https://nginx.org/en/docs/
type: documentation
- resource:
title: Apache Bench official documentation
link: https://httpd.apache.org/docs/2.4/programs/ab.html
type: documentation
- resource:
title: Docker overview
link: https://docs.docker.com/get-started/overview/
type: documentation
- resource:
title: Nginx on Azure
link: https://docs.nginx.com/nginx/deployment-guides/microsoft-azure/virtual-machines-for-nginx/
type: documentation


### FIXED, DO NOT MODIFY
# ================================================================================
weight: 1 # _index.md always has weight of 1 to order correctly
layout: "learningpathall" # All files under learning paths have this same wrapper
learning_path_main_page: "yes" # This should be surfaced when looking for related content. Only set for _index.md of learning path content.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
# ================================================================================
# FIXED, DO NOT MODIFY THIS FILE
# ================================================================================
weight: 21 # Set to always be larger than the content in this path to be at the end of the navigation.
title: "Next Steps" # Always the same, html page title.
layout: "learningpathall" # All files under learning paths have this same wrapper for Hugo processing.
---
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "Overview"

weight: 2

layout: "learningpathall"
---

## Cobalt 100 Arm-based processor

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.

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).

## Azure Linux 3.0

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.

## Nginx

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.

There are three main variants of Nginx:
- **Nginx Open Source**– Free and [open-source version available at nginx.org](https://nginx.org)
- **Nginx Plus**- [Commercial edition of Nginx](https://www.nginx.com/products/nginx/) with features like dynamic reconfig, active health checks, and monitoring.
- **Nginx Unit**- A lightweight, dynamic application server that complements Nginx. [Learn more at unit.nginx.org](https://unit.nginx.org/).


Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
title: Nginx Baseline Testing
weight: 6

### FIXED, DO NOT MODIFY
layout: learningpathall
---


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we already have testing locally and via web browser that Nginx is working, this page may be redundant. Instead, you can add a link on the previous page to nginx getting started content, eg https://nginx.org/en/docs/beginners_guide.html

### Baseline testing with a static website on Nginx
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.

1. Create a Static Website Directory:

Prepare a folder to host your HTML content.
```console
mkdir -p ~/my-static-site
```
2. Create an HTML file and Web page:

Create a HTML file `nano my-static-site/index.html` with the content below to design a visually appealing static landing page.

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Welcome to NGINX on Azure Linux</title>
<style>
body {
background: linear-gradient(to right, #4facfe, #00f2fe);
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
color: white;
text-align: center;
}
.box {
background: rgba(0, 0, 0, 0.3);
padding: 40px;
border-radius: 12px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}
h1 {
margin-bottom: 10px;
font-size: 2.5rem;
}
p {
font-size: 1.2rem;
}
</style>
</head>
<body>
<div class="box">
<h1> Welcome to NGINX on Azure Linux 3.0!</h1>
<p>Your static site is running beautifully on ARM64 </p>
</div>
</body>
</html>
```
3. Create NGINX Config File to Serve Static Website:

Point Nginx to serve your static HTML content.
```console
sudo nano /etc/nginx/conf.d/static-site.conf
```
Now, add the following configuration:

```nginx
server {
listen 80;
server_name localhost;

location / {
root /home/azureuser/my-static-site;
index index.html;
}

access_log /var/log/nginx/static-access.log;
error_log /var/log/nginx/static-error.log;
}
```
Make sure `/home/azureuser/my-static-site` is the correct path to your **index.html**.

4. Test the Nginx Configuration:

```console
sudo nginx -t
```
You should see an output similar to:
```output
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
```

5. Reload or Restart Nginx:

Apply configuration changes and restart the web server.
```console
sudo nginx -s reload
sudo systemctl restart nginx
```

6. Test the Static Website on browser:

Access your website at your public IP on port 80.
```console
http://<your-vm-public-ip>/
```
Make sure port 80 is open in your Azure Network Security Group (NSG).

7. You should see the Nginx welcome page confirming a successful deployment:

![Static Website Screenshot](images/web-page.png)

This verifies the basic functionality of Nginx installation before proceeding to the benchmarking.
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
---
title: Nginx Benchmarking
weight: 7

### FIXED, DO NOT MODIFY
layout: learningpathall
---

## Nginx Benchmarking by ApacheBench

**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.

1. Install ApacheBench

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Ubuntu 24, replace sudo dnf install with:

sudo apt-get update
sudo apt-get install apache2-utils

```console
sudo dnf install httpd-tools
```

2. Verify Installation

```console
ab -V
```
You should see an output similar to:

```output
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
```

3. Basic Benchmark Command Syntax

```console
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
```
Example:

```console
ab -n 1000 -c 50 http://localhost/
```
This sends **1000 total requests** with **50 concurrent connections** to `http://localhost/`.

You should see an output similar to:
```output
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests


Server Software: nginx/1.25.4
Server Hostname: localhost
Server Port: 80

Document Path: /
Document Length: 615 bytes

Concurrency Level: 50
Time taken for tests: 0.049 seconds
Complete requests: 1000
Failed requests: 0
Total transferred: 848000 bytes
HTML transferred: 615000 bytes
Requests per second: 20352.51 [#/sec] (mean)
Time per request: 2.457 [ms] (mean)
Time per request: 0.049 [ms] (mean, across all concurrent requests)
Transfer rate: 16854.42 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.2 1 2
Processing: 0 1 0.2 1 2
Waiting: 0 1 0.3 1 2
Total: 1 2 0.1 2 3

Percentage of the requests served within a certain time (ms)
50% 2
66% 2
75% 2
80% 2
90% 2
95% 3
98% 3
99% 3
100% 3 (longest request)
```

### Benchmark Results Table Explained:

- **Requests per second** – How many requests were served per second.
- **Time per request** – Average latency per request.
- **Transfer rate** – Data throughput.
- **Connection times** – Breakdown of min/mean/max connect, processing, and total times.
- **Percentage served** – Percentile distribution of response times.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removing all the content from here to the end of the page, and simply mention if they wish to benchmark results across architectures and instance types, they can run this benchmark on each, and compare the results on their own.

### Benchmark summary on x86_64:

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**.

| **Category** | **Metric** | **Value on Virtual Machine** | **Value on Docker** |
| ------------------------- | ---------------------------------------------- | ------------------- | ------------------- |
| **General Info** | Server Software | nginx/1.25.4 | nginx/1.25.4 |
| | Server Hostname | localhost | localhost |
| | Server Port | 80 | 80 |
| | Document Path | / | / |
| | Document Length | 615 bytes | 615 bytes |
| **Test Setup** | Concurrency Level | 50 | 50 |
| | Time Taken for Tests | 0.049 sec | 0.027 sec |
| | Complete Requests | 1000 | 1000 |
| | Failed Requests | 0 | 0 |
| **Transfer Stats** | Total Transferred | 848000 bytes | 848000 bytes |
| | HTML Transferred | 615000 bytes | 615000 bytes |
| | Requests per Second | 20,352.51 [#/sec] | 37,510.78 [#/sec] |
| | Time per Request (mean) | 2.457 ms | 1.333 ms |
| | Time per Request (across all) | 0.049 ms | 0.027 ms |
| | Transfer Rate | 16,854.42 KB/sec | 31,063.62 KB/sec |
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 2 | 0 / 0 / 0.1 / 0 / 1 |
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 2 | 0 / 1 / 0.2 / 1 / 1 |
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.3 / 1 / 2 | 0 / 1 / 0.2 / 1 / 1 |
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 3 | 1 / 1 / 0.1 / 1 / 2 |


### Benchmark summary on Arm64:

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**.

| **Category** | **Metric** | **Value on Virtual Machine** | **Value on Docker** |
|---------------------------|--------------------------------------------------|--------------------------|---------------------------|
| **General Info** | Server Software | nginx/1.25.4 | nginx/1.25.4 |
| | Server Hostname | localhost | localhost |
| | Server Port | 80 | 80 |
| | Document Path | / | / |
| | Document Length | 615 bytes | 615 bytes |
| **Test Setup** | Concurrency Level | 50 | 50 |
| | Time Taken for Tests | 0.032 sec | 0.025 sec |
| | Complete Requests | 1000 | 1000 |
| | Failed Requests | 0 | 0 |
| **Transfer Stats** | Total Transferred | 848000 bytes | 848000 bytes |
| | HTML Transferred | 615000 bytes | 615000 bytes |
| | Requests per Second | 30,876.59 [#/sec] | 40,698.38 [#/sec] |
| | Time per Request (mean) | 1.619 ms | 1.229 ms |
| | Time per Request (across all) | 0.032 ms | 0.025 ms |
| | Transfer Rate | 25,569.67 KB/sec | 33,703.35 KB/sec |
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 | 0 / 0 / 0.1 / 0 / 1 |
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 2 | 0 / 1 / 0.1 / 1 / 1 |
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 | 0 / 1 / 0.1 / 1 / 1 |
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 | 1 / 1 / 0.1 / 1 / 1 |


### Highlights from Azure Linux Arm64 Benchmarking

- Achieved **30,876.59 requests/sec**, significantly outperforming x86_64 (20,352.51 requests/sec).
- Response time per request averaged **1.619 ms**, indicating high efficiency under 50 concurrent connections.
- **Zero failed requests**, ensuring full stability during the stress test.
- Consistently low **connection and processing times** (mean ≈ 1 ms).
Loading