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
title: Apply performance configuration and monitoring tools
2
+
title: Monitor performance with wrk and btop
3
3
weight: 70
4
4
5
5
### FIXED, DO NOT MODIFY
@@ -8,7 +8,11 @@ layout: learningpathall
8
8
9
9
## Apply configuration updates
10
10
11
-
Now that you have all your nginx deployments running across Intel, AMD, and ARM architectures, you can apply performance optimizations and install monitoring tools across all pods using the utility script.
11
+
Now that you have all your nginx deployments running across Intel and ARM architectures, you can monitor performance across each architecture using wrk to generate load and btop to monitor system performance.
12
+
13
+
{{% notice Note %}}
14
+
This tutorial uses wrk to generate load, which is readily available on apt and brew package managers. [wrk2](https://github.com/giltene/wrk2) is a modern fork of wrk with additional features. wrk was chosen for this tutorial due to its ease of install, but if you prefer to install and use wrk2 (or other http load generators) for your testing, feel free to do so.
15
+
{{% /notice %}}
12
16
13
17
### Apply performance configuration
14
18
@@ -21,12 +25,12 @@ The `nginx_util.sh` script includes a `put config` command that will:
21
25
1. Run the following command to apply the configuration updates:
22
26
23
27
```bash
24
-
./nginx_util.sh put config
28
+
./nginx_util.sh put btop
25
29
```
26
30
27
31
You will see output similar to the following:
28
32
29
-
```output
33
+
```outputI
30
34
Applying custom nginx.conf to all nginx pods...
31
35
configmap/nginx-config created
32
36
Updating nginx-amd-deployment...
@@ -46,17 +50,6 @@ Installing btop on nginx-intel-deployment-6f5bff9667-zdrqc...
46
50
✅ Custom nginx.conf applied and btop installed on all pods!
47
51
```
48
52
49
-
### Performance optimizations applied
50
-
51
-
The custom nginx configuration includes several performance optimizations:
52
-
53
-
-**Auto worker processes**: `worker_processes auto` scales based on CPU cores
54
-
-**File caching**: Optimized for high I/O performance with `open_file_cache`
55
-
-**Access logs enabled**: Logs requests for monitoring and debugging
56
-
-**TCP optimizations**: `tcp_nopush` and `tcp_nodelay` enabled
57
-
-**Connection management**: Optimized timeouts and 100,000 keep-alive requests
58
-
-**Memory management**: Automatic connection cleanup for non-responding clients
59
-
60
53
### Verify configuration updates
61
54
62
55
2. Check that all pods have restarted with the new configuration:
@@ -67,32 +60,28 @@ kubectl get pods -n nginx
67
60
68
61
You should see all pods with recent restart times.
69
62
70
-
3. Verify the custom nginx configuration is applied by checking one pod:
71
-
72
-
```bash
73
-
kubectl exec -n nginx $(kubectl get pods -l arch=intel -n nginx -o name | sed 's/pod\///') -- grep "worker_processes auto" /etc/nginx/nginx.conf
74
-
```
75
63
76
-
You should see:
77
-
```output
78
-
worker_processes auto;
79
-
```
80
-
81
-
4. Verify btop is installed and available:
64
+
4. Verify btop is installed and available on both Arm and Intel pods:
82
65
83
66
```bash
84
67
kubectl exec -n nginx $(kubectl get pods -l arch=intel -n nginx -o name | sed 's/pod\///') -- btop --version
68
+
kubectl exec -n nginx $(kubectl get pods -l arch=arm -n nginx -o name | sed 's/pod\///') -- btop --version
85
69
```
86
70
87
-
You should see the btop version information.
71
+
You should see btop version information for both pods.
72
+
73
+
{{% notice Note %}}
74
+
Because pods are ephemeral, btop will need to be reinstalled if the pods are deleted or restarted in the future. If you get an error saying btop is not found, simply rerun the `./nginx_util.sh put btop` command to reinstall it.
75
+
{{% /notice %}}
76
+
88
77
89
78
### Monitor pod performance
90
79
91
80
5. You can now login to any pod and use btop to monitor system performance:
92
81
93
82
```bash
94
83
# Login to AMD pod (replace with intel or arm as needed)
95
-
./nginx_util.sh login amd
84
+
./nginx_util.sh login arm
96
85
```
97
86
98
87
Once inside the pod, run btop to see real-time system monitoring:
@@ -101,19 +90,16 @@ Once inside the pod, run btop to see real-time system monitoring:
101
90
btop
102
91
```
103
92
104
-
Press `q` to quit btop when finished.
105
-
106
-
### Test services still work
107
-
108
-
6. Verify that all services are still responding correctly after the configuration update:
93
+
With btop open on the remote pod, from your local machine, run wrk against the pod to generate load. The nginx_util.sh script includes a wrk wrapper command that makes it easy to use the wrk utility to load test an endpoint:
109
94
110
95
```bash
111
-
./nginx_util.sh get intel
112
-
./nginx_util.sh get amd
113
-
./nginx_util.sh get arm
114
-
./nginx_util.sh get multiarch
96
+
./nginx_util.sh wrk arm
115
97
```
116
98
117
-
All services should return the nginx welcome page, confirming that the performance optimizations are working correctly.
99
+
100
+
Press `q` to quit btop when finished.
101
+
102
+
### Test services still work
103
+
118
104
119
105
You have successfully applied performance optimizations and monitoring tools to your multi-architecture nginx cluster!
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/multiarch_nginx_on_aks/_index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ learning_objectives:
15
15
16
16
prerequisites:
17
17
- An [Azure account](https://azure.microsoft.com/en-us/free/).
18
-
- A local machine with [jq](https://jqlang.org/download/), [curl](https://curl.se/download.html), [Azure CLI](/install-guides/azure-cli/) and [kubectl](/install-guides/kubectl/) installed.
18
+
- A local machine with [jq](https://jqlang.org/download/), [curl](https://curl.se/download.html), [wrk](https://github.com/wg/wrk), [Azure CLI](/install-guides/azure-cli/) and [kubectl](/install-guides/kubectl/) installed.
0 commit comments