@@ -5,14 +5,24 @@ Test http client, object serialize and deserialize and file descriptor leeks.
5
5
Each service has ` /test ` endpoint which calls another api using http client and returns that api response as JSON.
6
6
7
7
## Start containers
8
+
8
9
` docker-compose up --build `
9
10
10
- ## Run load test
11
+ docker-compose should start 3 containers
12
+ 1 ) go lang api with GET ` /data ` endpoint
13
+ 2 ) go lang api with GET ` /test ` endpoint which calls 1 endpoint
14
+ 3 ) .net core api with GET ` /test ` endpoint which calls 1 endpoint
15
+
16
+ ## Run load tests
11
17
12
18
```
13
19
brew install wrk
14
- // now go to wrk folder and run
15
- make run
20
+ cd wrk
21
+ // .net core
22
+ URL=http://localhost:5000 make run
23
+
24
+ // golang
25
+ URL=http://localhost:5001 make run
16
26
```
17
27
18
28
## Check for file descriptors leeks
@@ -25,7 +35,7 @@ Count TIME_WAIT state
25
35
26
36
## Results
27
37
28
- ### .net core api
38
+ ### .net core api ( http://localhost:5000)
29
39
30
40
```
31
41
wrk --connections 256 --duration 100s --threads 8 --timeout 5s --latency --script /Users/anma/go/src/github.com/anjmao/netcore-vs-golang/wrk/requests.lua http://localhost:5000
@@ -52,7 +62,7 @@ MEMORY: 90MB
52
62
TIME_WAIT file descriptors: ~3000
53
63
```
54
64
55
- ### golang api
65
+ ### golang api ( http://localhost:5001)
56
66
57
67
```
58
68
wrk --connections 256 --duration 100s --threads 8 --timeout 5s --latency --script /Users/anma/go/src/github.com/anjmao/netcore-vs-golang/wrk/requests.lua http://localhost:5001
@@ -79,3 +89,8 @@ MEMORY: 10MB
79
89
TIME_WAIT file descriptors: 4
80
90
```
81
91
92
+ ## My machine spec
93
+
94
+ MacBook Pro (15-inch, 2017)
95
+ Processor 2,9 GHz Intel Core i7
96
+ Memory 16 GB 2133 MHz LPDDR3
0 commit comments