[ovs-dev] [PATCH] ovs-ctl: Don't decrease max open fds if already set higher

Andy Gospodarek gospo at redhat.com
Thu May 8 19:23:23 UTC 2014


On Thu, May 08, 2014 at 08:45:25PM +0200, Thomas Graf wrote:
> A user may set LimitNOFILE through systemd or other means to set
> the maximum number of open file descriptors. Only modify the ulimit
> if not already set to a higher value by the user.
> 
> Signed-off-by: Thomas Graf <tgraf at suug.ch>

Seems reasonable.

Acked-by: Andy Gospodarek <gospo at redhat.com>

> ---
>  utilities/ovs-ctl.in | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
> index 0735160..2f39519 100755
> --- a/utilities/ovs-ctl.in
> +++ b/utilities/ovs-ctl.in
> @@ -227,7 +227,10 @@ start_forwarding () {
>          # On Linux, ovs-vswitchd needs about three file descriptors
>          # per bridge and one file descriptor per bridge port, so this
>          # allows a very large number of bridges and ports.
> -        ulimit -n 7500
> +        MAXFD=7500
> +        if [ $(ulimit -n) -lt $MAXFD ]; then
> +            ulimit -n $MAXFD
> +        fi
>  
>  	    # Start ovs-vswitchd.
>  	    set ovs-vswitchd unix:"$DB_SOCK"
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list