Skip to content

Commit 44bf945

Browse files
committed
Review feedback
1 parent 0528a22 commit 44bf945

File tree

2 files changed

+52
-43
lines changed

2 files changed

+52
-43
lines changed

tests/reconfig/results/v1.0.0.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,34 @@ NGF deployment:
1919

2020
## Results Table
2121

22-
| Test number | NumResources | TimeToReadyTotal | TimeToReadyAvgSingle | NGINX reloads (total) | NGINX reload avg time (ms) |
23-
| ----------- | ------------ | ---------------- | -------------------- | --------------------- | -------------------------- |
24-
| 1 | 30 | 5 | 5 | 1 (2) | 166 |
25-
| 1 | 150 | 7 | 7 | 1 (2) | 353 |
26-
| 2 | 30 | 21 | <1 | 29 (30) | 142 |
27-
| 2 | 150 | 123 | <1 | 45 (46) | 190 |
28-
| 3 | 30 | <1 | <1 | 92 (93) | 137 |
29-
| 3 | 150 | 1 | 1 | 452 (453) | 127 |
22+
| Test number | NumResources | TimeToReadyTotal (s) | TimeToReadyAvgSingle (s) | NGINX reloads | NGINX reload avg time (ms) |
23+
| ----------- | ------------ | -------------------- | ------------------------ | ------------- | -------------------------- |
24+
| 1 | 30 | 5 | 5 | 2 | 166 |
25+
| 1 | 150 | 7 | 7 | 2 | 353 |
26+
| 2 | 30 | 21 | <1 | 30 | 142 |
27+
| 2 | 150 | 123 | <1 | 46 | 190 |
28+
| 3 | 30 | <1 | <1 | 93 | 137 |
29+
| 3 | 150 | 1 | 1 | 453 | 127 |
30+
31+
## NumResources -> Total Resources
32+
| NumResources | Gateways | Secrets | ReferenceGrants | Namespaces | application Pods | application Services | HTTPRoutes | Total Resources |
33+
| ------------ | -------- | ------- | --------------- | ---------- | ---------------- | -------------------- | ---------- | --------------- |
34+
| x | 1 | 1 | 1 | x+1 | 2x | 2x | 3x | <total> |
35+
| 30 | 1 | 1 | 1 | 31 | 60 | 60 | 90 | 244 |
36+
| 150 | 1 | 1 | 1 | 151 | 300 | 300 | 450 | 1204 |
3037

3138
## Observations
3239

3340
1. We are reloading after reconciling a ReferenceGrant even when there is no Gateway. This is because we treat every
34-
upsert/delete of a ReferenceGrant as a change. This means we will regenerate nginx config every time a ReferenceGrant
41+
upsert/delete of a ReferenceGrant as a change. This means we will regenerate NGINX config every time a ReferenceGrant
3542
is created, updated (generation must change), or deleted, even if it does not apply to the accepted Gateway.
3643

44+
Issue filed: https://github.com/nginxinc/nginx-gateway-fabric/issues/1124
45+
3746
2. We are reloading after reconciling a HTTPRoute even when there is no accepted Gateway and no config being generated.
3847

48+
Issue filed: https://github.com/nginxinc/nginx-gateway-fabric/issues/1123
49+
3950
3. All reloads were in the <500ms bucket. A slight increase in the reload time based on number of configured resources
4051
resulting in NGINX configuration changes was observed.
4152

tests/reconfig/setup.md

+32-34
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Reconfig tests
22

3+
## Goals
4+
5+
- Measure how long it takes NGF to reconfigure NGINX when a number of Gateway API and referenced core Kubernetes
6+
resources are created at once.
7+
- Two runs of each test should be ran with differing numbers of resources. Each run will deploy:
8+
- a single Gateway, Secret, and ReferenceGrant resources
9+
- `x+1` number of namespaces
10+
- `2x` number of backend apps and services
11+
- `3x` number of HTTPRoutes.
12+
- Where x=30 OR x=150.
13+
14+
## Test Environment
15+
16+
The following cluster will be sufficient:
17+
18+
- A Kubernetes cluster with 3 nodes on GKE
19+
- Node: e2-medium (2 vCPU, 4GB memory)
20+
321
## Setup
422

523
1. Create cloud cluster
@@ -16,8 +34,7 @@
1634
--create-namespace --wait -n nginx-gateway
1735
```
1836

19-
4. Optional: Add pod scrape if running in GKE (see [GKE Pod scrape config](#gke-pod-scrape-config)).
20-
5. Run tests:
37+
4. Run tests:
2138
1. There are 3 versions of the reconfiguration tests that need to be ran, with a low and high number of resources.
2239
Therefore, a full test suite includes 6 test runs.
2340
2. There are scripts to generate the required resources and config changes.
@@ -29,16 +46,18 @@
2946
- Note: Clean up after each test run for isolated results. There's a script provided for removing all the test
3047
fixtures `scripts/delete-multiple.sh` which takes a number (needs to be the same number as what was used in the
3148
create script.)
32-
6. After each individual test run, grab logs of both NGF containers and grab metrics.
49+
5. After each individual test run, grab logs of both NGF containers and grab metrics.
3350
Note: You can expose metrics by running the below snippet and then navigating to `127.0.0.1:9113/metrics`:
3451

3552
```bash
3653
GW_POD=$(k get pods -n nginx-gateway | sed -n '2s/^\([^[:space:]]*\).*$/\1/p')
3754
kubectl port-forward $GW_POD -n nginx-gateway 9113:9113 &
3855
```
3956

40-
7. Measure Time To Ready by as described in each test, get the reload count, and get the average NGINX reload duration.
41-
8. For accuracy, repeat the test suite once or twice, take the averages, and look for any anomolies/ outliers.
57+
6. Measure Time To Ready as described in each test, get the reload count, and get the average NGINX reload duration.
58+
The average reload duration can be computed by taking the `nginx_gateway_fabric_nginx_reloads_milliseconds_sum`
59+
metric value and dividing it by the `nginx_gateway_fabric_nginx_reloads_milliseconds_count` metric value.
60+
7. For accuracy, repeat the test suite once or twice, take the averages, and look for any anomolies or outliers.
4261

4362
## Tests
4463

@@ -48,49 +67,28 @@
4867
1. Use either of the provided scripts with the required number of resources,
4968
e.g. `cd scripts && bash create-resources-gw-last.sh 30`. The script will deploy backend apps and services, wait
5069
60 seconds for them to be ready, and deploy 1 Gateway, 1 RefGrant, 1 Secret, and HTTPRoutes.
51-
2. Deploy NFG
52-
3. Check logs for time takes from start-up -> config written and NGINX reloaded. Get reload count and average reload
70+
2. Deploy NGF
71+
3. Check logs for time it takes from start-up -> config written and NGINX reloaded. Get reload count and average reload
5372
duration from metrics and logs.
5473

5574
### Test 2: Start NGF, deploy Gateway, create many resources attached to GW
5675

57-
1. Deploy all Gateway resources, NFG running:
58-
1. Deploy NFG
76+
1. Deploy all Gateway resources, NGF running:
77+
1. Deploy NGF
5978
2. Run the provided script with the required number of resources,
6079
e.g. `cd scripts && bash create-resources-routes-last.sh 30`. The script will deploy backend apps and services,
6180
wait 60 seconds for them to be ready, and deploy 1 Gateway, 1 Secret, 1 RefGrant, and HTTPRoutes at the same time.
62-
3. Check logs for time takes from NFG receiving first resource update -> final config written, and NGINX's final
81+
3. Check logs for time it takes from NGF receiving first resource update -> final config written, and NGINX's final
6382
reload. Check logs for average individual HTTPRoute TTR also. Get reload count and average reload duration from
6483
metrics and logs.
6584

6685
### Test 3: Start NGF, create many resources attached to a Gateway, deploy the Gateway
6786

68-
1. Deploy HTTPRoute resources, NFG running, Gateway last:
69-
1. Deploy NFG
87+
1. Deploy HTTPRoute resources, NGF running, Gateway last:
88+
1. Deploy NGF
7089
2. Run the provided script with the required number of resources,
7190
e.g. `cd scripts && bash create-resources-gw-last.sh 30`.
7291
The script will deploy the namespaces, backend apps and services, 1 Secret, 1 ReferenceGrant, and the HTTPRoutes;
7392
wait 60 seconds for the backend apps to be ready, and then deploy 1 Gateway for all HTTPRoutes.
74-
3. Check logs for time takes from NFG receiving gateway resource -> config written and NGINX reloaded. Get reload
93+
3. Check logs for time it takes from NGF receiving gateway resource -> config written and NGINX reloaded. Get reload
7594
count and average reload duration from metrics and logs.
76-
77-
## GKE Pod scrape config
78-
79-
To create a Pod scrape config, you can run the following:
80-
81-
```bash
82-
cat <<EOF | kubectl apply -f -
83-
apiVersion: monitoring.googleapis.com/v1
84-
kind: PodMonitoring
85-
metadata:
86-
name: prom-example
87-
namespace: nginx-gateway
88-
spec:
89-
selector:
90-
matchLabels:
91-
app.kubernetes.io/name: nginx-gateway
92-
endpoints:
93-
- port: metrics
94-
interval: 30s
95-
EOF
96-
```

0 commit comments

Comments
 (0)