You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/nginx-on-azure/baseline.md
+32-45Lines changed: 32 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,20 @@ weight: 5
6
6
layout: learningpathall
7
7
---
8
8
9
+
# Baseline test NGINX with a static website
9
10
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.
12
12
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:
16
15
```console
17
16
mkdir -p /var/www/my-static-site
18
17
cd /var/www/my-static-site
19
18
```
20
-
2. Create an HTML file and Web page:
21
19
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
23
21
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:
24
23
```html
25
24
<!DOCTYPE html>
26
25
<htmllang="en">
@@ -56,30 +55,25 @@ Create a simple HTML file to replace the default NGINX welcome page. Using a fil
56
55
</head>
57
56
<body>
58
57
<divclass="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>
61
60
</div>
62
61
</body>
63
62
</html>
64
63
```
65
-
3. Adjust Permissions:
66
-
67
-
Ensure that NGINX (running as the www-data user) can read the files in your custom site directory:
68
64
65
+
## Adjust permissions
66
+
Ensure that NGINX (running as the **www-data** user) can read the files in your custom site directory:
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/.
77
70
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/**:
78
73
```console
79
74
sudo nano /etc/nginx/conf.d/static-site.conf
80
75
```
81
-
Add the following configuration to it:
82
-
76
+
Add the following configuration:
83
77
```console
84
78
server {
85
79
listen 80 default_server;
@@ -97,54 +91,47 @@ server {
97
91
error_log /var/log/nginx/static-error.log;
98
92
}
99
93
```
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:
107
95
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
109
100
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.
111
102
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:
112
105
```console
113
106
sudo unlink /etc/nginx/sites-enabled/default
114
107
```
115
108
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:
120
111
```console
121
112
sudo nginx -t
122
113
```
123
-
You should see output similar to:
114
+
Expected output:
124
115
```output
125
116
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
126
117
nginx: configuration file /etc/nginx/nginx.conf test is successful
127
118
```
128
-
If you see both lines, your configuration is valid.
129
-
130
-
7. Reload or Restart NGINX:
131
119
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:
133
122
```console
134
123
sudo nginx -s reload
135
124
sudo systemctl restart nginx
136
125
```
137
126
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:
142
129
```console
143
130
http://<your-vm-public-ip>/
144
131
```
145
132
146
-
9. You should see the NGINX welcome page confirming a successful deployment:
You should see your custom page instead of the default welcome page:
135
+

149
136
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.
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/nginx-on-azure/benchmarking.md
+53-49Lines changed: 53 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,48 +6,51 @@ weight: 6
6
6
layout: learningpathall
7
7
---
8
8
9
-
## NGINX Benchmarking by ApacheBench
9
+
#Benchmark NGINX with ApacheBench (ab) on Ubuntu Pro 24.04 LTS
10
10
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.
12
12
13
+
## Install ApacheBench
13
14
14
-
1. Install ApacheBench
15
+
On **Ubuntu Pro 24.04 LTS**, ApacheBench is provided by the **apache2-utils** package:
15
16
16
-
On **Ubuntu Pro 24.04 LTS**, ApacheBench is available as part of the `apache2-utils` package:
17
17
```console
18
18
sudo apt update
19
-
sudo apt install apache2-utils -y
19
+
sudo apt install -y apache2-utils
20
20
```
21
21
22
-
2.Verify Installation
22
+
Verify the installation:
23
23
24
24
```console
25
25
ab -V
26
26
```
27
-
You should see output similar to:
27
+
28
+
Expected output:
28
29
29
30
```output
30
31
This is ApacheBench, Version 2.3 <$Revision: 1923142 $>
31
32
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
32
33
Licensed to The Apache Software Foundation, http://www.apache.org/
33
34
```
34
35
35
-
3. Basic Benchmark Syntax
36
+
## Run a basic benchmark
36
37
37
38
The general syntax for running an ApacheBench test is:
38
39
39
40
```console
40
41
ab -n <total_requests> -c <concurrent_clients> <http://host:port/path>
41
42
```
42
43
43
-
Now run an example:
44
+
Example (1,000 requests, 50 concurrent, to the NGINX default page on localhost):
44
45
45
46
```console
46
47
ab -n 1000 -c 50 http://localhost/
47
48
```
48
-
This sends **1000 total requests** with **50 concurrent connections** to `http://localhost/`.
49
49
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
+
51
54
```output
52
55
This is ApacheBench, Version 2.3 <$Revision: 1903618 $>
53
56
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)
104
107
100% 2 (longest request)
105
108
```
106
109
107
-
###Interpret Benchmark Results:
110
+
## Interpret benchmark results
108
111
109
112
ApacheBench outputs several metrics. Key ones to focus on include:
110
113
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**.
|| 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**:
- 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.
149
153
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