tsenart / vegeta

HTTP load testing tool and library. It's over 9000!
http://godoc.org/github.com/tsenart/vegeta/lib
MIT License
23.06k stars 1.34k forks source link

How does vegeta adjust connection creation? #602

Closed fred214 closed 1 year ago

fred214 commented 2 years ago

I did some stress testing in Kubernets via vegeta

  1. test in cluster with internal K8s service endpoint, there are only two connections and the test can finished
    
    watch -d ss -s
    Total: 3
    TCP:   110 (estab 2, closed 108, orphaned 1, timewait 2)

Transport Total IP IPv6 RAW 0 0 0 UDP 0 0 0 TCP 2 2 0 INET 2 2 0 FRAG 0 0 0

2. Using same rate, test with ingress endpoint through nginx controller, there are so many connections vegeta created and the test cannot finished

watch -d ss -s Total: 13175 TCP: 24640 (estab 10833, closed 11470, orphaned 0, timewait 0)

Transport Total IP IPv6 RAW 0 0 0 UDP 0 0 0 TCP 13170 13170 0 INET 13170 13170 0 FRAG 0 0 0


I guess testing with ingress endpoint, will through SNAT->LB->Ingress controller->SVC, the latency increased, for guaranteeing the request rate, vegeta need to create more tcp connections to send the request. 
Is my understanding right?
Even if I set the `-max-connections` at 10, the vegeta also create connections more then it. Is that mean for guaranteeing the request rate, vegeta will create connections as closer as the `-max-connections`?
tsenart commented 1 year ago

I guess testing with ingress endpoint, will through SNAT->LB->Ingress controller->SVC, the latency increased, for guaranteeing the request rate, vegeta need to create more tcp connections to send the request. Is my understanding right?

Yes.

Even if I set the -max-connections at 10, the vegeta also create connections more then it. Is that mean for guaranteeing the request rate, vegeta will create connections as closer as the -max-connections?

-max-connections limits the total number of connections per host, including connections in the dialing, active, and idle states.

Were you seeing something different? Closing since it's been a long time. If still relevant please re-open.