tsenart / vegeta

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

Unusual number of used port & Error "bind: address already in use" #583

Closed yukha-dw closed 1 year ago

yukha-dw commented 2 years ago

Question

Hello, when i am trying to test an API, sometimes my vegeta client will spawn a huge swarm of connections eventhough i'm only asking for 2000 connections with a rate of 10k as setup below:

-connections=2000 -duration=5m -rate=10000 -timeout=1s

I checked using lsof, the highest number it shown is 60k, as high as number of available port? Is it an expected result of busy API or there is a known bug and i just have to restart the vegeta client? Thank you

$ lsof -n -i | grep "vegeta" -c Output > 60439

puneet-traceable commented 1 year ago

I was also facing this. Seems like max-workers default value is very high. I changed it no of cores * 4 and it started working well.

tsenart commented 1 year ago

If the API is slow to respond then a given port can't be reused until the response comes back. The connections param doesn't limit the number of open connections, only idle connections. Try setting max-workers.

Also make sure to tune your ulimits. Search the reader for ulimit to learn more.