Skip to content

Does fasthttp.Client take care of half-open/half-closed connections? #627

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

Closed
moredure opened this issue Aug 12, 2019 · 9 comments
Closed

Comments

@moredure
Copy link
Contributor

No description provided.

@erikdubbelboer
Copy link
Collaborator

What do you mean with a half-closed connection?

@moredure moredure changed the title Does fasthttp.Client take care of half-closed connections? Does fasthttp.Client take care of half-open connections? Aug 12, 2019
@moredure
Copy link
Contributor Author

moredure commented Aug 12, 2019

lsof show me many sock files with can't identify protocol status sometimes near 200k entries with requests per seconds rate near 4k to many different hosts (web crawling)

@moredure moredure changed the title Does fasthttp.Client take care of half-open connections? Does fasthttp.Client take care of half-open/half-closed connections? Aug 12, 2019
@moredure
Copy link
Contributor Author

Probably relates with #630

@erikdubbelboer
Copy link
Collaborator

Sounds like something in the TCP layer unrelated to fasthttp. Could it be that these are sockets in the TIME_WAIT state?

@moredure
Copy link
Contributor Author

moredure commented Aug 13, 2019

I am using SO_REUSEPORT, thereis only near 30k connections in time wait, 1600+ ESTABLISHED

root@crawler:~# lsof -n | grep "can't" | wc -l
175825
root@crawler:~# netstat -nt  | wc -l
31598

@moredure
Copy link
Contributor Author

Probably I am trapped into golang/go#18588

@moredure
Copy link
Contributor Author

I found the root cause. Fasthttp is nice lib. My fault.

@erikdubbelboer
Copy link
Collaborator

@mikefaraponov would you mind sharing what the cause was?

@moredure
Copy link
Contributor Author

The reason in spawning unknown can't identify protocol messages in lsof -n was SO_REUSEPORT behavior for client side connections, it's absolutely normal. The root cause of degraded performance was another dnscache library, even not a library itself but my missing of knowledge how it works internally

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

No branches or pull requests

2 participants