Skip to content

Commit a3d20c7

Browse files
committed
Update README.md
1 parent 05cd64b commit a3d20c7

File tree

1 file changed

+47
-75
lines changed

1 file changed

+47
-75
lines changed

README.md

+47-75
Original file line numberDiff line numberDiff line change
@@ -9,102 +9,74 @@
99

1010
* DNSPerf 2.14.0
1111

12-
## Preflight checklist
12+
## 🔥 Stress Test 🔥 Benchmark with Kubernetes Pods
1313

14-
### Does CoreDNS running expected version?
14+
Apply pre-configured testing deployment/pods
1515

16-
$ kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].image}'
16+
```bash
17+
kubectl apply -f https://raw.githubusercontent.com/guessi/dnsperf-bench/main/k8s-dnsperf-bench.yaml
18+
```
1719

18-
### Does CoreDNS running with expected Corefile?
20+
Make sure the deployment is running as expected
1921

20-
$ kubectl get configmap coredns -n kube-system -o jsonpath='{$.data.Corefile}'
2122

22-
### Does CoreDNS running with correct resources configuration?
23+
```bash
24+
kubectl get pods -l app=dnsperf
25+
NAME READY STATUS RESTARTS AGE
26+
dnsperf-7b9cc5b497-d5nfs 1/1 Running 0 1m16s
27+
```
2328

24-
$ kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].resources}'
29+
Check benchmark results
2530

26-
## Benchmark with Kubernetes Pods
31+
```bash
32+
kubectl logs -f deployments/dnsperf
33+
...
34+
Statistics:
35+
...
36+
Queries per second: 17241.513774
37+
...
38+
```
2739

28-
### Apply pre-configured testing deployment/pods
40+
Even more stress 🔥🔥🔥
2941

30-
$ kubectl apply -f https://raw.githubusercontent.com/guessi/dnsperf-bench/master/k8s-dnsperf-bench.yaml
31-
configmap/dns-records-config created
32-
deployment.apps/dnsperf created
42+
```bash
43+
kubectl scale deployments/dnsperf --replicas 10
44+
```
3345

34-
### Find out your Kubernetes DNS service IP address
46+
## 🤔 Evaluate why there would have performance issue
3547

36-
$ kubectl get service kube-dns -n kube-system -o jsonpath='{$.spec.clusterIP}'
48+
Does CoreDNS running expected version?
3749

38-
### If your DNS service address is not "10.100.0.10", you will need to change the value of predefined "DNS_SERVER_ADDR"
50+
```bash
51+
kubectl describe deployments coredns -n kube-system | grep 'Image:'
52+
```
3953

40-
$ kubectl edit deployment dnsperf
54+
Does CoreDNS running with expected Corefile?
4155

42-
### Make sure the deployment is running as expected
56+
```bash
57+
kubectl describe configmap coredns -n kube-system
58+
```
4359

44-
$ kubectl get deploy dnsperf
60+
Does CoreDNS running with correct resources configuration?
4561

46-
NAME READY UP-TO-DATE AVAILABLE AGE
47-
dnsperf 1/1 1 1 81s
62+
```bash
63+
kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].resources}' | jq -r '.'
64+
```
4865

49-
$ kubectl get pods -l app=dnsperf
66+
Does CoreDNS need more CPU/Memory resources?
5067

51-
NAME READY STATUS RESTARTS AGE
52-
dnsperf-7b9cc5b497-d5nfs 1/1 Running 0 1m16s
68+
```bash
69+
kubectl top pods -n kube-system -l k8s-app=kube-dns
70+
```
5371

54-
### To check benchmark results
72+
How many CoreDNS Pods running? Have you enabled CoreDNS AutoScaler?
5573

56-
$ kubectl logs -f deployments/dnsperf
74+
```bash
75+
kubectl get deployments coredns -n kube-system
76+
```
5777

58-
DNS Performance Testing Tool
59-
Version 2.14.0
78+
> DO NOT report bug without trying to do performance tuning. If you try to gain too much stress without tuning CoreDNS configureation, it is expected to have some TIMEOUT or packet losts. It's expected if you don't change.
6079
61-
[Status] Command line: dnsperf -f any -m udp -s 10.100.0.10 -p 53 -d /opt/records.txt -c 1 -T 1 -l 30 -t 5 -Q 100000
62-
[Status] Sending queries (to 10.100.0.10:53)
63-
[Status] Started at: Thu Apr 11 16:47:46 2024
64-
[Status] Stopping after 30.000000 seconds
65-
[Status] Testing complete (time limit)
66-
67-
Statistics:
68-
69-
Queries sent: 517317
70-
Queries completed: 517317 (100.00%)
71-
Queries lost: 0 (0.00%)
72-
73-
Response codes: NOERROR 517317 (100.00%)
74-
Average packet size: request 43, response 160
75-
Run time (s): 30.004152
76-
Queries per second: 17241.513774
77-
78-
Average Latency (s): 0.004805 (min 0.000101, max 0.029327)
79-
Latency StdDev (s): 0.002537
80-
81-
82-
### Check resources utilization of the CoreDNS deployment
83-
84-
$ kubectl top pods -n kube-system -l k8s-app=kube-dns
85-
86-
NAME CPU(cores) MEMORY(bytes)
87-
coredns-79989457d9-fn2hc 1644m 15Mi
88-
coredns-79989457d9-xss5l 925m 16Mi
89-
90-
## Stress Test
91-
92-
### You may gain more replicas to stress your CoreDNS even harder
93-
94-
$ kubectl scale deployments/dnsperf --replicas 4
95-
96-
deployment.apps/dnsperf scaled
97-
98-
### After gaining workload, you should find it's CPU utilization even higher
99-
100-
$ kubectl top pods -n kube-system -l k8s-app=kube-dns
101-
102-
NAME CPU(cores) MEMORY(bytes)
103-
coredns-79989457d9-fn2hc 1839m 17Mi
104-
coredns-79989457d9-xss5l 1344m 16Mi
105-
106-
> If you try to gain too much stress without tuning CoreDNS configureation (e.g. CPU, Memory, Replicas of CoreDNS), you should find some TIMEOUT, packet losts. That's expected... don't report it as bug! you should give CoreDNS more resources to handle that stress.
107-
108-
## Reference
80+
## 📑 Reference
10981

11082
- https://www.dnsperf.com/

0 commit comments

Comments
 (0)