-
Notifications
You must be signed in to change notification settings - Fork 397
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
listen on ipv4 addresses - high cpu #269
Comments
@deekshithd if you just want to log the local socket address of the incoming client connection, you need to add a As for your high CPU usage when listening on IPv4 addresses, this is surprising. My usual approach is to enable debug logging, and look for any unusual activity, then take a look at systrace. Can you reproduce this high CPU usage without NAT? A listener bound to an specific IPv6 address (i.e. not |
Persist local socket addresses for both client and server connections in connection object. Modify access log to use actual address connection was accepted on rather than listener address. This way when listening on 0.0.0.0 or :: will log the address the client connected to. This increases the size of the connection object and may otherwise negatively affect performance due to addition of getsockname() calls. GitHub issue #269 caveat emptor
Persist local socket addresses for both client and server connections in connection object. Modify access log to use actual address connection was accepted on rather than listener address. This way when listening on 0.0.0.0 or :: will log the address the client connected to. This increases the size of the connection object and may otherwise negatively affect performance due to addition of getsockname() calls. GitHub issue #269
Hi
I have multiple IPs mounted to my machine and using sniproxy, and I wanted to know on which IP the connection was accepted by sniproxy.
So, changed listen clauses in sniproxy config file to use ipv4 address (e.g. "listen a.b.c.d:8043 {...}"). After this change, seeing high cpu usage in sniproxy. Also, seeing high number of connection resets from client side. The client connections come thru a NAT.
Does anyone know what can be the issue here? Is this possible if the NAT from where connections are coming from using a mix of ipv4 and ipv6 connections? How does client behave if sniproxy only listening on ipv4 socket?
I assume to listen on both ipv4, and ipv6 and accept connections from both ipv4 and ipv6 end points, I should use the config like: "listen ::ffff:a.b.c.d:8043 {...}". Is this assumption correct?
Or can someone suggest what is the best way to know the IP address at which a connection was accepted, as well support both ipv4 and ipv6 connections coming to sniproxy?
Also, note that prior to this cpu issue, I was using "listen 8043 {...}" clause.
Thanks
The text was updated successfully, but these errors were encountered: