|
4 | 4 | [](https://hub.docker.com/r/guessi/dnsperf/)
|
5 | 5 | [](https://hub.docker.com/r/guessi/dnsperf/)
|
6 | 6 |
|
7 |
| - |
8 | 7 | ## Integrated Items
|
9 | 8 |
|
10 | 9 | * DNSPerf 2.14.0
|
11 | 10 |
|
12 |
| -## Preflight checklist |
13 |
| - |
14 |
| -### Does CoreDNS running expected version? |
15 |
| - |
16 |
| - $ kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].image}' |
17 |
| - |
18 |
| -### Does CoreDNS running with expected Corefile? |
19 |
| - |
20 |
| - $ kubectl get configmap coredns -n kube-system -o jsonpath='{$.data.Corefile}' |
21 |
| - |
22 |
| -### Does CoreDNS running with correct resources configuration? |
23 |
| - |
24 |
| - $ kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].resources}' |
25 |
| - |
26 |
| -## Benchmark with Kubernetes Pods |
27 |
| - |
28 |
| -### Apply pre-configured testing deployment/pods |
| 11 | +## 🔢 Preflight checklist |
29 | 12 |
|
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 |
| 13 | +Does CoreDNS running expected version? |
33 | 14 |
|
34 |
| -### Find out your Kubernetes DNS service IP address |
| 15 | +```bash |
| 16 | +kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].image}' | cut -d':' -f2 |
| 17 | +``` |
35 | 18 |
|
36 |
| - $ kubectl get service kube-dns -n kube-system -o jsonpath='{$.spec.clusterIP}' |
| 19 | +Does CoreDNS running with expected Corefile? |
37 | 20 |
|
38 |
| -### If your DNS service address is not "10.100.0.10", you will need to change the value of predefined "DNS_SERVER_ADDR" |
| 21 | +```bash |
| 22 | +kubectl get configmap coredns -n kube-system -o jsonpath='{$.data.Corefile}' |
| 23 | +``` |
39 | 24 |
|
40 |
| - $ kubectl edit deployment dnsperf |
| 25 | +Does CoreDNS running with correct resources configuration? |
41 | 26 |
|
42 |
| -### Make sure the deployment is running as expected |
| 27 | +```bash |
| 28 | +kubectl get deployments coredns -n kube-system -o jsonpath='{$.spec.template.spec.containers[0].resources}' | jq -r '.' |
| 29 | +``` |
43 | 30 |
|
44 |
| - $ kubectl get deploy dnsperf |
| 31 | +## 🧪 Benchmark with Kubernetes Pods |
45 | 32 |
|
46 |
| - NAME READY UP-TO-DATE AVAILABLE AGE |
47 |
| - dnsperf 1/1 1 1 81s |
| 33 | +Apply pre-configured testing deployment/pods |
48 | 34 |
|
49 |
| - $ kubectl get pods -l app=dnsperf |
| 35 | +```bash |
| 36 | +kubectl apply -f https://raw.githubusercontent.com/guessi/dnsperf-bench/main/k8s-dnsperf-bench.yaml |
| 37 | +``` |
50 | 38 |
|
51 |
| - NAME READY STATUS RESTARTS AGE |
52 |
| - dnsperf-7b9cc5b497-d5nfs 1/1 Running 0 1m16s |
| 39 | +Make sure the deployment is running as expected |
53 | 40 |
|
54 |
| -### To check benchmark results |
55 | 41 |
|
56 |
| - $ kubectl logs -f deployments/dnsperf |
| 42 | +```bash |
| 43 | +kubectl get pods -l app=dnsperf |
| 44 | +NAME READY STATUS RESTARTS AGE |
| 45 | +dnsperf-7b9cc5b497-d5nfs 1/1 Running 0 1m16s |
| 46 | +``` |
57 | 47 |
|
58 |
| - DNS Performance Testing Tool |
59 |
| - Version 2.14.0 |
| 48 | +Check benchmark results |
60 | 49 |
|
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) |
| 50 | +```bash |
| 51 | +kubectl logs -f deployments/dnsperf |
| 52 | +... |
| 53 | +Statistics: |
| 54 | + ... |
| 55 | + Queries per second: 17241.513774 |
| 56 | + ... |
| 57 | +``` |
66 | 58 |
|
67 |
| - Statistics: |
| 59 | +Check resources utilization of the CoreDNS deployment |
68 | 60 |
|
69 |
| - Queries sent: 517317 |
70 |
| - Queries completed: 517317 (100.00%) |
71 |
| - Queries lost: 0 (0.00%) |
| 61 | +```bash |
| 62 | +kubectl top pods -n kube-system -l k8s-app=kube-dns |
| 63 | +``` |
72 | 64 |
|
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 |
| 65 | +## 🔥 Stress Test |
91 | 66 |
|
92 | 67 | ### You may gain more replicas to stress your CoreDNS even harder
|
93 | 68 |
|
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 |
| 69 | +```bash |
| 70 | +kubectl scale deployments/dnsperf --replicas 10 |
| 71 | +``` |
99 | 72 |
|
100 |
| - $ kubectl top pods -n kube-system -l k8s-app=kube-dns |
| 73 | +## 👀 Check CPU utilization (should be higher then usual) |
101 | 74 |
|
102 |
| - NAME CPU(cores) MEMORY(bytes) |
103 |
| - coredns-79989457d9-fn2hc 1839m 17Mi |
104 |
| - coredns-79989457d9-xss5l 1344m 16Mi |
| 75 | +```bash |
| 76 | +kubectl top pods -n kube-system -l k8s-app=kube-dns |
| 77 | +``` |
105 | 78 |
|
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. |
| 79 | +> If you try to gain too much stress without tuning CoreDNS configureation, it is expected to have some TIMEOUT or packet losts. |
| 80 | +> |
| 81 | +> That's expected results... don't report it as bug! you should give CoreDNS more resources to handle that stress. |
107 | 82 |
|
108 |
| -## Reference |
| 83 | +## 📑 Reference |
109 | 84 |
|
110 | 85 | - https://www.dnsperf.com/
|
0 commit comments