8000 Why are there so many TIME_WAIT connections? · Issue #981 · fabiolb/fabio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Why are there so many TIME_WAIT connections? #981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shiling02404 opened this issue Mar 25, 2025 · 1 comment
Open

Why are there so many TIME_WAIT connections? #981

shiling02404 opened this issue Mar 25, 2025 · 1 comment

Comments

@shiling02404
Copy link

I am using version 1.6.3 with HTTP proxy mode. Why does Fabio frequently create new connections to the same backend target service (e.g., 10.111.75.126) instead of reusing existing ones? When I check the Fabio machine(e.g.,10.111.76.65) using netstat, for example:

netstat -anp | grep '10.111.75.126' | grep 'TIME_WAIT'
I see around 200+ TIME_WAIT state entries. However, when I run:

netstat -anp | grep '10.111.75.126' | grep 'EST'
I only see 2 ESTABLISHED connections. Repeatedly executing this command shows that these ESTABLISHED ports change almost every second, indicating that connections are briefly used and then actively closed, resulting in a large number of TIME_WAIT states. If the request concurrency increases, won’t this lead to even more new connections and more TIME_WAIT entries? Is this a configuration issue?

------fabio.properties----
proxy.localip=127.0.0.1
proxy.strategy=rr
proxy.matcher=prefix
proxy.maxconn=10000
registry.consul.addr=10.111.76.65:8500
registry.consul.token=
registry.consul.kvpath=/fabio/config
registry.consul.tagprefix=urlprefix-
registry.consul.register.enabled = false
log.access.format = common
proxy.addr=:9999;proto=http
log.level = DEBUG

--------netstat----

[user@10_111_76_65 ~]# netstat -anp|grep '10.111.75.126'|grep 'TIME_WAIT' |wc -l
264
[user@10_111_76_65 ~]# netstat -anp|grep '10.111.75.126'|grep 'EST' |wc -l
2

@tristanmorgan
Copy link
Member

I have been investigating and when multiple incoming connections are being made, multiple connections to the backend services will be made. There are connection reuse strategies that some of the commercial load-balancers use, but that could also introduce issues with things like proxy protocol headers. If there was a large demand for implementing this feature it would be considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0