Skip to content

Commit f26c92b

Browse files
authored
Merge pull request #2325 from pareenaverma/content_review
Tech review of NGINX Azure LP
2 parents 88e4fa1 + d4b7e7c commit f26c92b

5 files changed

Lines changed: 116 additions & 105 deletions

File tree

content/learning-paths/servers-and-cloud-computing/nginx-on-azure/_index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,22 @@ cascade:
77

88
minutes_to_complete: 30
99

10-
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.
10+
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-based instances.
1111

1212
learning_objectives:
1313
- Start an Azure Arm64 virtual machine using the Azure console and Ubuntu Pro 24.04 LTS as the base image.
14-
- Deploy the NGINX web server on the Azure Arm64 virtual machine running Ubuntu Pro 24.04 LTS.
14+
- Deploy the NGINX web server on the Azure Arm64 virtual machine.
1515
- Configure and test a static website using NGINX on the virtual machine.
1616
- Perform baseline testing and benchmarking of NGINX in the Ubuntu Pro 24.04 LTS Arm64 virtual machine environment.
1717

1818

1919
prerequisites:
2020
- A [Microsoft Azure](https://azure.microsoft.com/) account with access to Cobalt 100 based instances (Dpsv6).
21-
- Familiarity with the [NGINX architecture](https://www.nginx.com/) and deployment practices on Arm64 platforms.
22-
- Network settings (firewalls and security groups) should allow inbound communication on ports 22 (SSH) and 80 (HTTP).
2321

24-
author: Jason Andrews
22+
author: Pareena Verma
2523

2624
### Tags
27-
skilllevels: Advanced
25+
skilllevels: Introductory
2826
subjects: Web
2927
cloud_service_providers: Microsoft Azure
3028

content/learning-paths/servers-and-cloud-computing/nginx-on-azure/baseline.md

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ layout: learningpathall
88

99

1010
### 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.
11+
Once NGINX is installed and serving the default welcome page, the next step is to verify that it can serve your own content. A baseline test using a simple static HTML site ensures that NGINX is correctly configured and working as expected on your Ubuntu Pro 24.04 LTS virtual machine.
1212

1313
1. Create a Static Website Directory:
1414

1515
Prepare a folder to host your HTML content.
1616
```console
17-
mkdir -p ~/my-static-site
17+
mkdir -p /var/www/my-static-site
18+
cd /var/www/my-static-site
1819
```
1920
2. Create an HTML file and Web page:
2021

21-
Create a HTML file `nano my-static-site/index.html` with the content below to design a visually appealing static landing page.
22+
Create a simple HTML file to replace the default NGINX welcome page. Using a file editor of your choice create the file `index.html` with the content below:
2223

2324
```html
2425
<!DOCTYPE html>
@@ -61,69 +62,89 @@ Create a HTML file `nano my-static-site/index.html` with the content below to de
6162
</body>
6263
</html>
6364
```
64-
3. Move the Website to NGINX's Accessible Directory:
65+
3. Adjust Permissions:
6566

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+
Ensure that NGINX (running as the www-data user) can read the files in your custom site directory:
6768

6869
```console
69-
sudo mkdir -p /var/www/my-static-site
70-
sudo cp -r ~/my-static-site/* /var/www/my-static-site/
7170
sudo chown -R www-data:www-data /var/www/my-static-site
7271
```
72+
This sets the ownership of the directory and files so that the NGINX process can serve them without permission issues.
7373

74-
4. Create NGINX Config File to Serve Static Website:
74+
4. Update NGINX Configuration:
75+
76+
Point NGINX to serve files from your new directory by creating a dedicated configuration file under /etc/nginx/conf.d/.
7577

76-
Point NGINX to serve your static HTML content.
7778
```console
7879
sudo nano /etc/nginx/conf.d/static-site.conf
7980
```
80-
Now, add the following configuration:
81+
Add the following configuration to it:
8182

82-
```NGINX
83+
```console
8384
server {
84-
listen 80;
85-
server_name localhost;
85+
listen 80 default_server;
86+
listen [::]:80 default_server;
87+
server_name _;
88+
89+
root /var/www/my-static-site;
90+
index index.html;
8691

8792
location / {
88-
root /var/www/my-static-site;
89-
index index.html;
93+
try_files $uri $uri/ =404;
9094
}
9195

9296
access_log /var/log/nginx/static-access.log;
93-
error_log /var/log/nginx/static-error.log;
97+
error_log /var/log/nginx/static-error.log;
9498
}
9599
```
96-
Make sure `/home/ubuntu/my-static-site` is the correct path to your **index.html**.
100+
This configuration block tells NGINX to:
101+
- Listen on port 80 (both IPv4 and IPv6).
102+
- Serve files from /var/www/my-static-site.
103+
- Use index.html as the default page.
104+
- Log access and errors to dedicated log files for easier troubleshooting.
97105

98-
5. Test the NGINX Configuration:
106+
Make sure the path to your `index.html` file is correct before saving.
107+
108+
5. Disable the default site:
109+
110+
By default, NGINX comes with a packaged default site configuration. Since you have created a custom config, it is good practice to disable the default to avoid conflicts:
111+
112+
```console
113+
sudo unlink /etc/nginx/sites-enabled/default
114+
```
115+
116+
6. Test the NGINX Configuration:
117+
118+
Before applying your changes, always test the configuration to make sure there are no syntax errors:
99119

100120
```console
101121
sudo nginx -t
102122
```
103-
You should see an output similar to:
123+
You should see output similar to:
104124
```output
105125
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
106126
nginx: configuration file /etc/nginx/nginx.conf test is successful
107127
```
128+
If you see both lines, your configuration is valid.
108129

109-
6. Reload or Restart NGINX:
130+
7. Reload or Restart NGINX:
110131

111-
Apply configuration changes and restart the web server.
132+
After testing the configuration, apply your changes by reloading or restarting the NGINX service:
112133
```console
113134
sudo nginx -s reload
114135
sudo systemctl restart nginx
115136
```
116137

117-
7. Test the Static Website on browser:
138+
8. Test the Static Website in a browser:
118139

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

125-
8. You should see the NGINX welcome page confirming a successful deployment:
146+
9. You should see the NGINX welcome page confirming a successful deployment:
126147

127148
![Static Website Screenshot](images/nginx-web.png)
128149

129-
This verifies the basic functionality of NGINX installation before proceeding to the benchmarking.
150+
This verifies the basic functionality of NGINX installation and you can now proceed to benchmarking the performance of NGINX on your Arm-based Azure VM.

content/learning-paths/servers-and-cloud-computing/nginx-on-azure/benchmarking.md

Lines changed: 18 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ layout: learningpathall
88

99
## NGINX Benchmarking by ApacheBench
1010

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.
11+
To understand how your NGINX deployment performs under load, you can benchmark it using ApacheBench (ab). ApacheBench 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.
1212

1313

1414
1. Install ApacheBench
@@ -24,27 +24,30 @@ sudo apt install apache2-utils -y
2424
```console
2525
ab -V
2626
```
27-
You should see an output similar to:
27+
You should see output similar to:
2828

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

35-
3. Basic Benchmark Command Syntax
35+
3. Basic Benchmark Syntax
36+
37+
The general syntax for running an ApacheBench test is:
3638

3739
```console
3840
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
3941
```
40-
Example:
42+
43+
Now run an example:
4144

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

47-
You should see an output similar to:
50+
You should see a output similar to:
4851
```output
4952
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
5053
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
@@ -101,45 +104,14 @@ Percentage of the requests served within a certain time (ms)
101104
100% 2 (longest request)
102105
```
103106

104-
### Benchmark Results Table Explained:
107+
### Interpret Benchmark Results:
105108

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.
109+
ApacheBench outputs several metrics. Key ones to focus on include:
111110

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
111+
- Requests per second: Average throughput.
112+
- Time per request: Latency per request.
113+
- Failed request: Should ideally be zero.
114+
- Transfer rate: Bandwidth used by the responses.
143115

144116
### Benchmark summary on Arm64:
145117
Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pro 24.04 LTS virtual machine**.
@@ -166,13 +138,13 @@ Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pr
166138
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
167139
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 |
168140

169-
### Highlights from Ubuntu Pro 24.04 LTS Arm64 Benchmarking
141+
### Analysis of results from NGINX benchmarking on Arm-based Azure Cobalt-100
170142

171-
When comparing the results on Arm64 vs x86_64 virtual machines:
143+
These benchmark results highlight the strong performance characteristics of NGINX running on Arm64-based Azure VMs (such as the D4ps_v6 instance type):
172144

173-
- Achieved **31,523.86 requests/sec**, demonstrating high throughput under concurrent load.
145+
- High Requests Per second(31,523.86 requests/sec), demonstrating high throughput under concurrent load.
174146
- Response time per request averaged **1.586 ms**, indicating efficient handling of requests with minimal delay.
175147
- **Zero failed requests**, confirming stability and reliability during testing.
176148
- Consistently low **connection and processing times** (mean ≈ 1 ms), ensuring smooth performance.
177149

178-
You have now benchmarked NGINX on an Azure Cobalt 100 Arm64 virtual machine and compared results with x86_64.
150+
Overall, these results illustrate that NGINX on Arm64 machines provides a highly performant solution for web workloads on Azure. You can also use the same benchmarking framework to compare results on equivalent x86-based Azure instances, which provides useful insight into relative performance and cost efficiency across architectures.

0 commit comments

Comments
 (0)