Comments (6)
@at15 yes, that was the idea. From documentation for Transport (https://golang.org/src/net/http/transport.go):
// Transports should be reused instead of created as needed.
// Transports are safe for concurrent use by multiple goroutines.
Transport objects are designed to be shared. So, IMO it makes sense to create a single transport object, set a reasonably high MaxIdleConnsPerHost if c is too big and and share it between workers (The default is 100). In my tests this had no performance penalty.
I don't see much benefit of creating a transport per worker. I am not sure why @rakyll chose to do it that way, but maybe there is something I overlooked.
from hey.
I think this is fixed now. Please reopen if you see the same behavior.
from hey.
some error are connect: cannot assign requested address
, found a similar problem here , change MaxIdleConnsPerHost
may work, both hey and the server should be reusing connection by default.
Also I tried hey -n 16384 -c 16384 "http://127.0.0.1:8081/health"
on my PC. without changing ulimit
the only error I got is socket: too many open files
, after ulimit -n 4096
, the error reduced a lot
⇒ hey -n 16384 -c 4096 "http://127.0.0.1:8000"
14596 requests done.
16380 requests done.
All requests done.
Summary:
Total: 5.5077 secs
Slowest: 5.3914 secs
Fastest: 0.0000 secs
Average: 0.0894 secs
Requests/sec: 2971.8209
Total data: 294624 bytes
Size/request: 18 bytes
Status code distribution:
[200] 16368 responses
Response time histogram:
0.000 [1] |
0.539 [15920] |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
1.078 [358] |∎
1.617 [88] |
2.157 [0] |
2.696 [0] |
3.235 [0] |
3.774 [0] |
4.313 [0] |
4.852 [0] |
5.391 [1] |
Latency distribution:
10% in 0.0020 secs
25% in 0.0105 secs
50% in 0.0392 secs
75% in 0.0737 secs
90% in 0.1951 secs
95% in 0.2456 secs
99% in 1.0030 secs
Error distribution:
[16] Get http://127.0.0.1:8000: dial tcp 127.0.0.1:8000: socket: too many open files
I am using a desktop PC with Ubuntu 16.04 and Go1.7
from hey.
I had a PR that could help this in old project: rakyll/boom#112
Currently hey creates a client with 2 idle channels per worker. If it uses a single client with C idle channels (or some high enough maximum if C is too high) it probably helps the situation.
I don't have my setup for go / hey now, feel free to test the PR and see if it works.
from hey.
@mdakin so your PR let all workers share one client and set MaxIdleConnsPerHost: b.C
would make the client keep b.C
connections like a pool, so the problem of running out of port can be avoided. Is my understanding correct?
btw: some other benchmark tools seems to be creating new client for each worker like hey
does ie: go-wrk
from hey.
A small correction, default for MaxIdleConnsPerHost is 2, MaxIdleConns is 100.
from hey.
Related Issues (20)
- Cannot find packge in $GOPATH and $GOROOT HOT 2
- Add support for json payload.
- hey!!!!
- AWS sigv4 support
- Controlling requests per second HOT 1
- Please add a option for read a stream response.
- Self Signed Certs
- header regex is too restrictive HOT 1
- Latency difference Hey tool vs Locust
- Does hey write EOF to remaining parallel connections opened when desired number of requests gets answered by server?
- Vulnerability of dependency "golang.org/x/net, golang.org/x/text"
- Do you have any documentation to explain what each information in the summary generated by "hey" means?
- Bug: Inaccurate histogram HOT 1
- Abandoned? HOT 2
- Hey, sending different requests read from a file?
- Is there a Default Duration of Load Test? 10 min?
- Sending request bodies in multiple http frames
- Trivial test with 1 request and 1 worker times out, but curl works fine
- Weird negative numbers in result HOT 1
- Binary download links 403 forbidden.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hey.