Skip to content

Commit 45ace05

Browse files
committed
lab5 remove wrk
1 parent 99ed138 commit 45ace05

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
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

+5-5
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:

0 commit comments

Comments
 (0)