-
Notifications
You must be signed in to change notification settings - Fork 49
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
Q:Why does the bindresvport_sa function use ports 600 ~ 1023? #305
Comments
See https://man7.org/linux/man-pages/man3/bindresvport.3.html The range is so that some of the reserved ports (under 1024) are reserved for assigned services. I'm not quite sure where Ganesha is calling bindresvport though, what is the stack back trace? |
Thanks for the reply. |
When the ganesha of this container is restarted frequently for a short period of time, this interface is called to bind a large number of ports because it needs to logout rpc and register rpc each time it is started, and it also needs to logout rpc when it is stopped. Sometimes the port 875 is occupied, although it is immediately released, but there is a period of time_wait state, the next time the startup will fail to bind port 875, the quota port default 875. The rpc service registration, each time, is registering one version of one service, one network protocol, so registering all the services, needs to be executed many times. And each time it will apply for a new port occupation, and then release, this mechanism will occupy a large number of ports for a short period of time, of course, soon after all will be released. Of course, it's just my weird way of using it that causes this problem. /**
|
Port 875 for rquotad is specified in /etc/services. You could configure it differently. Or, if you don't actually need RQUOTA you could disable it. Why are you restarting Ganesha so often? I suppose we should also look at making it so Ganesha does all the rpcbind registrations with one connection... |
I did some reliability testing and repeated reboots just to test.
Yes, that sounds great. It's more efficient and less resource intensive to use a single connection. |
Open a Ganesha issue for this, and ideally consider submitting a patch. |
Another option here that I have proposed in the past if for Ganesha to take over the rpcbind service and not use RPC to communicate with it... This idea is somewhat less exciting than Ganesha taking over rpc.statd... |
Otherwise, can we close this? If desired, please open a Ganesha issue |
When ganesha tries to connect to other services, such as rpcbind, the ports 600~1023 are used when calling the bindresvport_sa interface(assuming that AF_LOCAL is not used), is there any particular reason for this, can't we just have the system assign a random source port?
code see:
Ganesha uses a lot of ports in this segment when it starts up, binds one for every request, and then releases it, but there is a time_wait time, and the next time it picks a new port, all of which occupy a lot of ports. This time may cause the bind port to fail for application services that use this port.
So can just set port to 0 and let the system assign a port, like this:
Or is there some kind of restriction that the ports here must be 600~1023?
The text was updated successfully, but these errors were encountered: