Download raw body.
bgpd(8): set daemon_timeout higher?
On 2025/06/29 11:27, Job Snijders wrote:
> On a tiny machine:
>
> cpu0: AMD GX-412TC SOC, 998.19 MHz, 16-30-01, patch 07030105
> cpu1: AMD GX-412TC SOC, 998.20 MHz, 16-30-01, patch 07030105
> cpu2: AMD GX-412TC SOC, 998.47 MHz, 16-30-01, patch 07030105
> cpu3: AMD GX-412TC SOC, 998.50 MHz, 16-30-01, patch 07030105
>
> Checking the bgpd(8) configuration takes a fair bit of time:
>
> $ time doas bgpd -n
> configuration OK
> 3m37.67s real 1m30.83s user 2m06.92s system
>
> It's slow because the configuration is large:
>
> $ doas bgpd -nv | wc -l
> 715434
>
> The config is large because of "include /var/db/rpki-client/openbgpd".
>
> Then the daemon bumps into ${daemon_timeout} and rc.subr kills it.
>
> Maybe bgpd(8) needs a bit more time to sort itself out?
daemon_timeout is shared between startup and shutdown and 5 minutes is
quite a long time to wait at shutdown if the processes don't exit properly.
I don't object to this diff (if we need it, we need it), so ok sthen,
though I wouldn't like to go beyond the 300 (i.e. people trying to
run a route server on something slower than an APU will need to set
bgpd_timeout in rc.conf.local themselves).
As far as ports goes, there are about 20 which touch timeout, I suspect
most are due to slow start - the only one I know for sure being due to
slow shutdown in squid.
I wonder if it would be worth splitting daemon_timeout and having
a separate timeout for shutdown? (e.g. daemon_timeout just does
startup, defaulting to 30s, and add a new daemon_shutdown_timeout, also
defaulting to 30s).
Anyone have opinions on that?
> Index: etc/rc.d/bgpd
> ===================================================================
> RCS file: /cvs/src/etc/rc.d/bgpd,v
> diff -u -p -r1.7 bgpd
> --- etc/rc.d/bgpd 29 Aug 2022 19:14:25 -0000 1.7
> +++ etc/rc.d/bgpd 29 Jun 2025 11:20:52 -0000
> @@ -3,6 +3,7 @@
> # $OpenBSD: bgpd,v 1.7 2022/08/29 19:14:25 ajacoutot Exp $
>
> daemon="/usr/sbin/bgpd"
> +daemon_timeout=300
>
> . /etc/rc.d/rc.subr
>
>
bgpd(8): set daemon_timeout higher?