1024 sessions problem

Ondrej Zajicek santiago at crfreenet.org
Mon Nov 2 23:28:56 CET 2015


On Tue, Nov 03, 2015 at 12:15:01AM +0300, Alexander V. Chernikov wrote:
>    Hi,
>    *
>    Currently, if the number of your established BGP sessions is larger than
>    FD_SETSIZE limit, then you will get 100% cpu usage on select() (returning
>    EINVAL for nfds) after trying to include the first fd>=FD_SETSIZE.
>    Probably, the better way of handling this would be by explicitly rejecting
>    active/passive sockets setup with proper error message so user could
>    rebuild bird with appropriate limit without spending time on diagnosing
>    100% cpu usage issue.

Hi

Thanks for the patch, that makes perfect sense. Will be merged ASAP.

BTW, is it possible to change the limit by just redefining it and
rebuilding BIRD? Aren't there any problems on the kernel side?

Just some minor comment:

> diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
>    if (sk_setup(t) < 0)
>    {
>      /* FIXME: Call err_hook instead ? */
> @@ -1404,6 +1415,12 @@ sk_open(sock *s)
>    if (fd < 0)
>      ERR("socket");
>  
> +  if (fd >= FD_SETSIZE)
> +  {
> +    log(L_ERR "Socket setup failed due to FD_SETSIZE limit (%d)", FD_SETSIZE);
> +    ERR2("FD_SETSIZE limit reached");
> +  }

It is unnecessary to do log() here, ERR2() stores the error message in the
socket and later it will be logged by the caller using sk_log_error().

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20151102/67f31df7/attachment.asc>


More information about the Bird-users mailing list