Skip to content

Commit b00b296

Browse files
committed
2 parents b827a88 + be61e44 commit b00b296

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

labs/lab5/final/upstreams.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
upstream nginx_cafe { # Upstream block, the name is "nginx_cafe"
77

88
# Uncomment the zone directive below to add metrics to the Dashboard
9-
# zone nginx_cafe 256k;
9+
zone nginx_cafe 256k;
1010

1111
# Load Balancing Algorithms supported by NGINX
1212
# - Round Robin (Default if nothing specified)
@@ -15,18 +15,18 @@ upstream nginx_cafe { # Upstream block, the name is "nginx_cafe"
1515
# - Hash (Any generic Hash)
1616

1717
# Uncomment for Least Time Last Byte algorithm
18-
# least_time last_byte;
18+
least_time last_byte;
1919

2020
# From Docker-Compose:
2121
server web1:80;
2222
server web2:80;
2323
server web3:80;
2424

2525
# Uncomment for Cookie persistence
26-
# sticky cookie srv_id expires=1m domain=.example.com path=/;
26+
sticky cookie srv_id expires=1m domain=.example.com path=/;
2727

2828

2929
# Uncomment for keepalive TCP connections to upstreams
30-
# keepalive 16;
30+
keepalive 16;
3131

3232
}

labs/lab5/readme.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ Different backend applications may benefit from using different load balancing t
874874
`wrk` load generation tool is a docker container that will download and run, with 4 threads, at 200 connections, for 1 minute:
875875
876876
```bash
877-
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://$NAME-nginx-plus/coffee
877+
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://nginx-plus/coffee
878878
879879
```
880880
@@ -950,7 +950,7 @@ Different backend applications may benefit from using different load balancing t
950950
951951
![Cafe with Keepalive](media/lab5_cafe-perf-keepalive.png)
952952
953-
>But this points out a very important concept to be aware of: NGINX uses HTTP/1.0 to all upstreams by default. HTTP/1.0 is limited to a single TCP connection for a single HTTP object on the web page. If you have hundreds of web objects, you will need hundreds of TCP connections. This is a large waste of time and resources, so adding TCP Keepalives and HTTP/1.1 will make a significant improvement in performance in most cases.
953+
>**But this points out a very important concept to be aware of: NGINX uses HTTP/1.0 to all upstreams by default.** HTTP/1.0 is limited to a single TCP connection for a single HTTP object on the web page. If you have hundreds of web objects, you will need hundreds of TCP connections. This is a large waste of time and resources, so adding TCP Keepalives and HTTP/1.1 will make a significant improvement in performance in most cases.
954954
955955
<br/>
956956
@@ -989,7 +989,7 @@ Different backend applications may benefit from using different load balancing t
989989
1. For a fun test, hit it again with `wrk`...what do you observe? Do admin weights help or hurt performance?
990990
991991
```bash
992-
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://$NAME-nginx-plus/coffee
992+
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://nginx-plus/coffee
993993
994994
```
995995
@@ -1053,7 +1053,7 @@ Different backend applications may benefit from using different load balancing t
10531053
1. You should now have `4 workers`, `least_time last_byte` and `keepalive` **enabled**. Run the `wrk` load generation tool again. **CRANK IT UP!**
10541054
10551055
```bash
1056-
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://$NAME-nginx-plus/coffee
1056+
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://nginx-plus/coffee
10571057
```
10581058
10591059
Within the `$NAME-nginx-plus` container, run `top` to see the NGINX Workers at work. Should look something like this:
@@ -1083,7 +1083,7 @@ Different backend applications may benefit from using different load balancing t
10831083
1. Run the `wrk` load generator again for 1 minute.
10841084
10851085
```bash
1086-
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://$NAME-nginx-plus/coffee
1086+
docker run --name wrk --network=lab5_default --rm elswork/wrk -t4 -c200 -d1m -H 'Host: cafe.example.com' --timeout 2s http://nginx-plus/coffee
10871087
```
10881088
10891089
After the 1 minute run of `wrk` load generation tool has finished, you should see a Summary of the statistics. It should look similar to this:
@@ -1220,7 +1220,7 @@ With NGINX, there are several configuration options for this, but in this next l
12201220
12211221
1. If you need to find the `answers` to the lab exercises, you will find the final NGINX configuration files for all the exercises in the `labs/lab5/final` folder. Use them for reference to compare how you completed the labs.
12221222
1223-
1. If you are finished with this lab move to the next lab. Please donot shut down your test environment as you would be using the same environment in lab6.
1223+
1. If you are finished with this lab move to the next lab. Please do not shut down your test environment as you would be using the same environment in Lab6.
12241224
12251225
**This completes Lab5.**
12261226

labs/lab6/readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# NGINX Plus Logs, Logging and Troubleshooting
1+
# NGINX Plus Logs, Health Checks and API
22

33
## Introduction
44

@@ -252,7 +252,7 @@ In this section, you will enable active Plus Healthchecks. Active healthchecks p
252252
1. NGINX also records health check failures in the `/var/log/nginx/error.log` file which is symlinked to `/dev/stderr` within our docker setup. If you run below command you can see the error.log content.
253253
254254
```bash
255-
docker log $NAME-nginx-plus
255+
docker logs $NAME-nginx-plus
256256
257257
```
258258
@@ -291,7 +291,7 @@ In this section, you will manage your backend servers dynamically using the NGIN
291291
1. Start the `wrk` load generation tool by downloading and running the following docker container.
292292
293293
```bash
294-
docker run --network=lab5_default --rm elswork/wrk -t4 -c200 -d20m -H 'Host: cafe.example.com' --timeout 2s http://$NAME-nginx-plus/coffee
294+
docker run --network=lab5_default --rm elswork/wrk -t4 -c200 -d20m -H 'Host: cafe.example.com' --timeout 2s http://nginx-plus/coffee
295295
296296
```
297297

labs/readme.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ Choose one of the [Lab 0: Workshop pre-work](#lab-0-workshop-pre-work-choose-any
6969
### Lab 5: NGINX Reverse Proxy and HTTP Load Balancing
7070
- [Lab 5: NGINX Reverse Proxy and HTTP Load Balancing](lab5/readme.md)
7171

72-
### Lab 6: NGINX Plus Logs, Logging and Troubleshooting
73-
- [Lab 6: NGINX Plus Logs, Logging and Troubleshooting](lab6/readme.md)
72+
### Lab 6: NGINX Plus Logs, Health Checks and API
73+
- [Lab 6: NGINX Plus Logs, Health Checks and API](lab6/readme.md)
7474

7575
### Lab 7: Monitoring NGINX Plus with Prometheus and Grafana
7676
- [Lab 7: Monitoring NGINX Plus with Prometheus and Grafana](lab7/readme.md)

0 commit comments

Comments
 (0)