Skip to content

Commit 950b52d

Browse files
author
ii2day
committed
optimize HTTP client performance
Signed-off-by: ii2day <ji.li@daocloud.io>
1 parent ba3afc2 commit 950b52d

43 files changed

Lines changed: 611 additions & 4239 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

charts/templates/configmap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ data:
1818
taskPollIntervalInSecond: {{ .Values.feature.taskPollIntervalInSecond }}
1919
nethttp_defaultRequest_Qps: {{ .Values.feature.nethttp_defaultRequest_Qps }}
2020
nethttp_defaultRequest_MaxQps: {{ .Values.feature.nethttp_defaultRequest_MaxQps }}
21+
nethttp_defaultConcurrency: {{ .Values.feature.nethttp_defaultConcurrency }}
22+
nethttp_defaultMaxIdleConnsPerHost: {{ .Values.feature.nethttp_defaultMaxIdleConnsPerHost }}
2123
nethttp_defaultRequest_DurationInSecond: {{ .Values.feature.nethttp_defaultRequest_DurationInSecond }}
2224
nethttp_defaultRequest_PerRequestTimeoutInMS: {{ .Values.feature.nethttp_defaultRequest_PerRequestTimeoutInMS }}
2325
multusPodAnnotationKey: {{ .Values.feature.multusPodAnnotationKey }}

charts/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ feature:
4040
## @param feature.nethttp_defaultRequest_MaxQps qps for kind nethttp
4141
nethttp_defaultRequest_MaxQps: 100
4242

43+
## @param feature.nethttp_defaultConcurrency concurrency for kind nethttp
44+
nethttp_defaultConcurrency: 50
45+
46+
## @param feature.nethttp_defaultMaxIdleConnsPerHost max idle connect for kind nethttp
47+
nethttp_defaultMaxIdleConnsPerHost: 50
48+
4349
## @param feature.nethttp_defaultRequest_DurationInSecond Duration In Second for kind nethttp
4450
nethttp_defaultRequest_DurationInSecond: 2
4551

docs/usage/performance.md

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,60 @@
2020

2121
# Nethttp
2222

23-
In a pod with a CPU of 1
23+
In a pod with a CPU of 1
24+
25+
The test server is a server that sleeps for one second and then returns
26+
## Http1.1
27+
28+
| client | time | requests | qps | Memory |
29+
|--------------|------|----------|---------|--------|
30+
| spiderdoctor | 0.5m | 81912 | 2988.67 | 210Mb |
31+
| hey | 0.5m | 58423 | 1947.42 | 210Mb |
2432

2533
| client | time | requests | qps | Memory |
2634
|--------------|------|----------|---------|--------|
27-
| spiderdoctor | 1m | 67346 | 1122.43 | 2Gi |
28-
| wrk | 1m | 53612 | 892.85 | 2Mb |
35+
| spiderdoctor | 1m | 179634 | 2,993.9 | 210Mb |
36+
| hey | 1m | 118452 | 1974.2 | 220Mb |
37+
38+
| client | time | requests | qps | Memory |
39+
|--------------|------|----------|---------|--------|
40+
| spiderdoctor | 5m | 897979 | 2993.26 | 210Mb |
41+
| hey | 5m | 596077 | 1986.92 | 270Mb |
42+
43+
44+
## Http2
45+
46+
| client | time | requests | qps | Memory |
47+
|--------------|------|----------|---------|--------|
48+
| spiderdoctor | 0.5m | 238787 | 7959.57 | 350Mb |
49+
| hey | 0.5m | 7213 | 240.44 | 110Mb |
50+
51+
| client | time | requests | qps | Memory |
52+
|--------------|------|-----------|----------|--------|
53+
| spiderdoctor | 1m | 481070 | 8017.83 | 370Mb |
54+
| hey | 1m | 14665 | 244.42 | 120Mb |
2955

3056
| client | time | requests | qps | Memory |
3157
|--------------|------|----------|----------|--------|
32-
| spiderdoctor | 5m | 272403 | 908.01 | 2.6Gi |
33-
| wrk | 5m | 265551 | 884.92 | 5Mb |
34-
35-
| client | time | requests | qps | Memory |
36-
|--------------|------|-----------|---------|--------|
37-
| spiderdoctor | 10m | 467254 | 778.75 | 4.5Gi |
38-
| wrk | 10m | 565638 | 942.58 | 5Mb |
58+
| spiderdoctor | 5m | 2419874 | 8066.25 | 390Mb |
59+
| hey | 5m | 74776 | 249.25 | 130Mb |
3960

4061

4162
# Netdns
4263

4364
In a pod with a CPU of 1
4465

45-
| client | time | requests | qps | Memory |
46-
|--------------|------|----------|-----------|--------|
47-
| spiderdoctor | 1m | 1855511 | 30,925.18 | 23Mb |
48-
| dnsperf | 1m | 1728086 |28800.406 | 8Mb |
66+
| client | time | requests | qps | Memory |
67+
|--------------|------|----------|------------|--------|
68+
| spiderdoctor | 1m | 1855511 | 30925.18 | 23Mb |
69+
| dnsperf | 1m | 1728086 | 28800.406 | 8Mb |
4970

50-
| client | time | requests | qps | Memory |
51-
|--------------|------|----------|-----------|--------|
52-
| spiderdoctor | 5m | 9171699 | 30,572.33 | 100Mb |
53-
| dnsperf | 5m | 8811137 | 29370.34 | 8Mb |
71+
| client | time | requests | qps | Memory |
72+
|--------------|------|----------|----------|--------|
73+
| spiderdoctor | 5m | 9171699 | 30572.33 | 100Mb |
74+
| dnsperf | 5m | 8811137 | 29370.34 | 8Mb |
5475

5576
| client | time | requests | qps | Memory |
5677
|--------------|------|-----------|-----------|--------|
57-
| spiderdoctor | 10m | 18561282 | 30,935.47 | 173Mb |
78+
| spiderdoctor | 10m | 18561282 | 30935.47 | 173Mb |
5879
| dnsperf | 10m | 17260779 | 28767.666 | 8Mb |

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ require (
2323
github.com/spf13/cobra v1.6.1
2424
github.com/spf13/viper v1.15.0
2525
github.com/spidernet-io/e2eframework v0.0.0-20221012075947-0a835b3d4cf9
26-
github.com/tsenart/vegeta/v12 v12.8.4
2726
go.opentelemetry.io/otel v1.12.0
2827
go.opentelemetry.io/otel/exporters/prometheus v0.33.0
2928
go.opentelemetry.io/otel/metric v0.34.0
@@ -83,7 +82,6 @@ require (
8382
github.com/huandu/xstrings v1.3.2 // indirect
8483
github.com/imdario/mergo v0.3.13 // indirect
8584
github.com/inconshreveable/mousetrap v1.0.1 // indirect
86-
github.com/influxdata/tdigest v0.0.1 // indirect
8785
github.com/josharian/intern v1.0.0 // indirect
8886
github.com/json-iterator/go v1.1.12 // indirect
8987
github.com/kr/pretty v0.3.0 // indirect

0 commit comments

Comments
 (0)