Skip to content

Commit 1a7124a

Browse files
Content dev
1 parent ea97167 commit 1a7124a

File tree

2 files changed

+85
-94
lines changed

2 files changed

+85
-94
lines changed

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

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,20 @@ weight: 5
66
layout: learningpathall
77
---
88

9+
# Baseline test NGINX with a static website
910

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

13-
1. Create a Static Website Directory:
14-
15-
Prepare a folder to host your HTML content.
13+
## Create a static website directory
14+
Prepare a folder to host your HTML content:
1615
```console
1716
mkdir -p /var/www/my-static-site
1817
cd /var/www/my-static-site
1918
```
20-
2. Create an HTML file and Web page:
2119

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:
20+
## Create an HTML file
2321

22+
Create a simple HTML page to replace the default NGINX welcome page. Using a file editor of your choice, create **index.html** with the following content:
2423
```html
2524
<!DOCTYPE html>
2625
<html lang="en">
@@ -56,30 +55,25 @@ Create a simple HTML file to replace the default NGINX welcome page. Using a fil
5655
</head>
5756
<body>
5857
<div class="box">
59-
<h1> Welcome to NGINX on Azure Ubuntu Pro 24.04 LTS!</h1>
60-
<p>Your static site is running beautifully on ARM64 </p>
58+
<h1>Welcome to NGINX on Azure Ubuntu Pro 24.04 LTS!</h1>
59+
<p>Your static site is running beautifully on Arm64</p>
6160
</div>
6261
</body>
6362
</html>
6463
```
65-
3. Adjust Permissions:
66-
67-
Ensure that NGINX (running as the www-data user) can read the files in your custom site directory:
6864

65+
## Adjust permissions
66+
Ensure that NGINX (running as the **www-data** user) can read the files in your custom site directory:
6967
```console
7068
sudo chown -R www-data:www-data /var/www/my-static-site
7169
```
72-
This sets the ownership of the directory and files so that the NGINX process can serve them without permission issues.
73-
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/.
7770

71+
## Update NGINX configuration
72+
Point NGINX to serve files from your new directory by creating a dedicated configuration file under **/etc/nginx/conf.d/**:
7873
```console
7974
sudo nano /etc/nginx/conf.d/static-site.conf
8075
```
81-
Add the following configuration to it:
82-
76+
Add the following configuration:
8377
```console
8478
server {
8579
listen 80 default_server;
@@ -97,54 +91,47 @@ server {
9791
error_log /var/log/nginx/static-error.log;
9892
}
9993
```
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.
105-
106-
Make sure the path to your `index.html` file is correct before saving.
94+
This configuration tells NGINX to:
10795

108-
5. Disable the default site:
96+
- listen on port 80 (IPv4 and IPv6)
97+
- serve files from `/var/www/my-static-site/`
98+
- use `index.html` as the default page
99+
- log access and errors to dedicated log files for easier troubleshooting
109100

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:
101+
Make sure the path to your `index.html` file is correct before saving.
111102

103+
## Disable the default site
104+
NGINX ships with a packaged default site configuration. Since you created a custom config, disable the default to avoid conflicts:
112105
```console
113106
sudo unlink /etc/nginx/sites-enabled/default
114107
```
115108

116-
6. Test the NGINX Configuration:
117-
118-
Before applying your changes, always test the configuration to make sure there are no syntax errors:
119-
109+
## Test the NGINX configuration
110+
Before applying your changes, test the configuration for syntax errors:
120111
```console
121112
sudo nginx -t
122113
```
123-
You should see output similar to:
114+
Expected output:
124115
```output
125116
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
126117
nginx: configuration file /etc/nginx/nginx.conf test is successful
127118
```
128-
If you see both lines, your configuration is valid.
129-
130-
7. Reload or Restart NGINX:
131119

132-
After testing the configuration, apply your changes by reloading or restarting the NGINX service:
120+
## Reload or restart NGINX
121+
Apply your changes by reloading or restarting the NGINX service:
133122
```console
134123
sudo nginx -s reload
135124
sudo systemctl restart nginx
136125
```
137126

138-
8. Test the Static Website in a browser:
139-
140-
Access your website at your public IP on port 80.
141-
127+
## Test the static website in a browser
128+
Access your website at your public IP on port 80:
142129
```console
143130
http://<your-vm-public-ip>/
144131
```
145132

146-
9. You should see the NGINX welcome page confirming a successful deployment:
147-
148-
![Static Website Screenshot](images/nginx-web.png)
133+
## Verify the page renders
134+
You should see your custom page instead of the default welcome page:
135+
![Custom static website served by NGINX on Azure VM alt-text#center](images/nginx-web.png)
149136

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.
137+
This verifies the basic functionality of the NGINX installation. You can now proceed to benchmarking NGINX performance on your Arm-based Azure VM.

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

Lines changed: 53 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,51 @@ weight: 6
66
layout: learningpathall
77
---
88

9-
## NGINX Benchmarking by ApacheBench
9+
# Benchmark NGINX with ApacheBench (ab) on Ubuntu Pro 24.04 LTS
1010

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.
11+
Use ApacheBench (**ab**) to measure NGINX performance on your Arm64 Azure VM. This section shows you how to install the tool, run a basic benchmark, interpret key metrics, and review a sample result from an Azure **D4ps_v6** instance.
1212

13+
## Install ApacheBench
1314

14-
1. Install ApacheBench
15+
On **Ubuntu Pro 24.04 LTS**, ApacheBench is provided by the **apache2-utils** package:
1516

16-
On **Ubuntu Pro 24.04 LTS**, ApacheBench is available as part of the `apache2-utils` package:
1717
```console
1818
sudo apt update
19-
sudo apt install apache2-utils -y
19+
sudo apt install -y apache2-utils
2020
```
2121

22-
2. Verify Installation
22+
Verify the installation:
2323

2424
```console
2525
ab -V
2626
```
27-
You should see output similar to:
27+
28+
Expected output:
2829

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

35-
3. Basic Benchmark Syntax
36+
## Run a basic benchmark
3637

3738
The general syntax for running an ApacheBench test is:
3839

3940
```console
4041
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
4142
```
4243

43-
Now run an example:
44+
Example (1,000 requests, 50 concurrent, to the NGINX default page on localhost):
4445

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

50-
You should see a output similar to:
50+
This command sends 1,000 total requests with 50 concurrent connections to `http://localhost/`.
51+
52+
Sample output:
53+
5154
```output
5255
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
5356
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
@@ -104,47 +107,48 @@ Percentage of the requests served within a certain time (ms)
104107
100% 2 (longest request)
105108
```
106109

107-
### Interpret Benchmark Results:
110+
## Interpret benchmark results
108111

109112
ApacheBench outputs several metrics. Key ones to focus on include:
110113

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.
115-
116-
### Benchmark summary on Arm64:
117-
Here is a summary of benchmark results collected on an Arm64 **D4ps_v6 Ubuntu Pro 24.04 LTS virtual machine**.
118-
119-
| **Category** | **Metric** | **Value** |
120-
|---------------------------|-------------------------------------------------|-------------------------------|
121-
| **General Info** | Server Software | nginx/1.24.0 |
122-
| | Server Hostname | localhost |
123-
| | Server Port | 80 |
124-
| | Document Path | / |
125-
| | Document Length | 890 bytes |
126-
| **Test Setup** | Concurrency Level | 50 |
127-
| | Time Taken for Tests | 0.032 sec |
128-
| | Complete Requests | 1000 |
129-
| | Failed Requests | 0 |
130-
| **Transfer Stats** | Total Transferred | 1,132,000 bytes |
131-
| | HTML Transferred | 890,000 bytes |
132-
| | Requests per Second | 31,523.86 [#/sec] |
133-
| | Time per Request (mean) | 1.586 ms |
134-
| | Time per Request (across all) | 0.032 ms |
135-
| | Transfer Rate | 34,848.65 KB/sec |
136-
| **Connection Times (ms)** | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
137-
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
138-
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
139-
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 |
140-
141-
### Analysis of results from NGINX benchmarking on Arm-based Azure Cobalt-100
142-
143-
These benchmark results highlight the strong performance characteristics of NGINX running on Arm64-based Azure VMs (such as the D4ps_v6 instance type):
114+
- Requests per second: average throughput
115+
- Time per request (mean): latency per request
116+
- Failed requests: should be **0**
117+
- Transfer rate: effective bandwidth
118+
119+
## Benchmark summary on Arm64
120+
121+
The following results were collected on an Arm64 **D4ps_v6** VM running **Ubuntu Pro 24.04 LTS**:
122+
123+
| Category | Metric | Value |
124+
|---------------------------|--------------------------------------------------|----------------------------|
125+
| General info | Server Software | nginx/1.24.0 |
126+
| | Server Hostname | localhost |
127+
| | Server Port | 80 |
128+
| | Document Path | / |
129+
| | Document Length | 890 bytes |
130+
| Test setup | Concurrency Level | 50 |
131+
| | Time Taken for Tests | 0.032 sec |
132+
| | Complete Requests | 1,000 |
133+
| | Failed Requests | 0 |
134+
| Transfer stats | Total Transferred | 1,132,000 bytes |
135+
| | HTML Transferred | 890,000 bytes |
136+
| | Requests per Second | 31,523.86 #/sec |
137+
| | Time per Request (mean) | 1.586 ms |
138+
| | Time per Request (across all) | 0.032 ms |
139+
| | Transfer Rate | 34,848.65 KB/sec |
140+
| Connection times (ms) | Connect (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
141+
| | Processing (min / mean / stdev / median / max) | 0 / 1 / 0.1 / 1 / 1 |
142+
| | Waiting (min / mean / stdev / median / max) | 0 / 1 / 0.2 / 1 / 1 |
143+
| | Total (min / mean / stdev / median / max) | 1 / 2 / 0.1 / 2 / 2 |
144+
145+
## Analysis of results from NGINX benchmarking on Arm-based Azure Cobalt-100
146+
147+
These results highlight the performance characteristics of NGINX on Arm64-based Azure VMs (such as **D4ps_v6**):
144148

145149
- High Requests Per second(31,523.86 requests/sec), demonstrating high throughput under concurrent load.
146-
- Response time per request averaged **1.586 ms**, indicating efficient handling of requests with minimal delay.
147-
- **Zero failed requests**, confirming stability and reliability during testing.
148-
- Consistently low **connection and processing times** (mean ≈ 1 ms), ensuring smooth performance.
150+
- Response time per request averaged 1.586 ms, indicating efficient handling of requests with minimal delay.
151+
- Zero failed requests, confirming stability and reliability during testing.
152+
- Consistently low connection and processing times (mean ≈ 1 ms), ensuring smooth performance.
149153

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.
154+
Overall, NGINX on Arm64 provides a performant, cost‑efficient platform for web workloads on Azure. You can use the same benchmark to compare with equivalent x86-based instances to evaluate relative performance and cost efficiency across architectures.

0 commit comments

Comments
 (0)