mirror_frr/doc/user
Stephen Worley a0b937de42 bgpd,doc: limit InQ buf to allow for back pressure
Add a default limit to the InQ for messages off the bgp peer
socket. Make the limit configurable via cli.

Adding in this limit causes the messages to be retained in the tcp
socket and allow for tcp back pressure and congestion control to kick
in.

Before this change, we allow the InQ to grow indefinitely just taking
messages off the socket and adding them to the fifo queue, never letting
the kernel know we need to slow down. We were seeing under high loads of
messages and large perf-heavy routemaps (regex matching) this queue
would cause a memory spike and BGP would get OOM killed. Modifying this
leaves the messages in the socket and distributes that load where it
should be in the socket buffers on both send/recv while we handle the
mesages.

Also, changes were made to allow the ringbuffer to hold messages and
continue to be filled by the IO pthread while we wait for the Main
pthread to handle the work on the InQ.

Memory spike seen with large numbers of routes flapping and route-maps
with dozens of regex matching:

```
Memory statistics for bgpd:
System allocator statistics:
  Total heap allocated:  > 2GB
  Holding block headers: 516 KiB
  Used small blocks:     0 bytes
  Used ordinary blocks:  160 MiB
  Free small blocks:     3680 bytes
  Free ordinary blocks:  > 2GB
  Ordinary blocks:       121244
  Small blocks:          83
  Holding blocks:        1
```

With most of it being held by the inQ (seen from the stream datastructure info here):

```
Type                          : Current#   Size       Total     Max#  MaxBytes
...
...
Stream                        :   115543 variable  26963208 15970740 3571708768
```

With this change that memory is capped and load is left in the sockets:

RECV Side:
```
State    Recv-Q    Send-Q                           Local Address:Port                         Peer Address:Port    Process
ESTAB    265350    0            [fe80::4080:30ff:feb0:cee3]%veth1:36950         [fe80::4c14:9cff:fe1d:5bfd]:179      users:(("bgpd",pid=1393334,fd=26))
         skmem:(r403688,rb425984,t0,tb425984,f1816,w0,o0,bl0,d61)

```

SEND Side:
```
State  Recv-Q  Send-Q                        Local Address:Port                  Peer Address:Port   Process
ESTAB  0       1275012   [fe80::4c14:9cff:fe1d:5bfd]%veth1:179    [fe80::4080:30ff:feb0:cee3]:36950   users:(("bgpd",pid=1393443,fd=27))
         skmem:(r0,rb131072,t0,tb1453568,f1916,w1300612,o0,bl0,d0)

```

Signed-off-by: Stephen Worley <sworley@nvidia.com>
2022-10-24 18:23:29 -04:00
..
_static doc: orange FRR theme 2019-02-18 14:39:13 +01:00
images doc: Augmented pathd documentation. 2021-10-04 18:56:47 +02:00
.gitignore doc: fix distclean 2018-05-18 19:35:24 +00:00
babeld.rst doc: Minor grammar correction 2021-12-23 07:32:33 +10:00
basic.rst doc: Add allow-reserved-ranges global command 2022-07-01 23:23:14 +03:00
bfd.rst Doc: Update documentation for BFD Echo. 2022-08-02 10:09:11 -04:00
bgp.rst bgpd,doc: limit InQ buf to allow for back pressure 2022-10-24 18:23:29 -04:00
bmp.rst bmp: add L3VPN support 2022-07-13 17:28:37 +02:00
bugs.rst doc: fix dupe bug-reports label, index entry 2021-02-23 15:49:19 -05:00
conf.py doc: use add_css_file(); not deprecated 2021-06-03 16:32:00 -04:00
eigrpd.rst doc: remove redundant index directives 2021-05-18 15:29:59 +03:00
extlog.rst doc: add new RFC5424 & journald logging targets 2022-01-17 00:39:00 +01:00
fabricd.rst *: remove *.conf.sample files 2021-04-09 13:14:30 -04:00
filter.rst lib: add "json" option to "show ip[v6] prefix-list" 2021-08-02 17:19:45 -03:00
flowspec.rst doc: remove 'no' form of commands 2021-02-22 14:38:21 -05:00
frr-reload.rst doc: add docs for frr-reload.py options 2020-05-26 19:14:12 +02:00
glossary.rst doc: fixup glossary for html build 2018-02-02 15:24:57 -05:00
grpc.rst doc: initial documentation for gRPC 2020-08-10 16:39:06 -03:00
index.rst doc: Add the document for PIMv6 2022-03-10 02:12:54 -08:00
installation.rst doc: Update doc w/ regards to realms 2022-06-23 13:56:28 -04:00
ipv6.rst doc: add doc for show ipv6 nd ra-interfaces 2021-06-08 15:17:22 -04:00
isisd.rst isisd: Add expected behavior with set-overload-bit 2022-10-12 10:52:27 -07:00
kernel.rst doc: remove obsolete Netlink discussion, fix svi cmd doc 2021-04-30 18:10:56 -05:00
ldpd.rst doc: document ldpd's "ttl-security" commands 2022-06-15 14:12:35 -03:00
Makefile build: non-recursive doc + parallel sphinx 2018-08-30 08:06:44 +02:00
nhrpd.rst doc: remove redundant index directives 2021-05-18 15:29:59 +03:00
ospf6d.rst doc: Fix spelling mistakes 2022-02-14 12:51:22 -05:00
ospf_fundamentals.rst doc: replace "passive-interface IFNAME" with "ip ospf passive" 2021-06-05 18:25:01 +03:00
ospfd.rst ospfd: few fixes in rSPF calc when LSA received from non root node 2022-10-12 13:43:55 +05:30
overview.rst doc: Update supported BGP RFC list 2022-09-25 11:58:10 +03:00
packet-dumps.rst doc: reorganize into multiple toctrees 2018-06-08 07:54:25 +00:00
pathd.rst doc: fix undefined label warning 2021-12-14 12:31:19 +03:00
pbr.rst pbrd: add vlan actions to vty 2021-10-07 09:14:59 -04:00
pim.rst pim6d: Update BSM cli/show/debug commands in pimv6.rst 2022-10-20 01:07:48 -07:00
pimv6.rst pim6d: Update BSM cli/show/debug commands in pimv6.rst 2022-10-20 01:07:48 -07:00
ripd.rst doc/user/ripd: clarify unicast behaviour 2022-08-05 17:11:43 +10:00
ripngd.rst doc: Fix the rip and ripng distribute-list ... commands 2021-05-04 16:23:37 -04:00
routemap.rst bgpd: add resolution for l3vpn traffic over gre interfaces 2022-09-05 22:26:25 +02:00
routeserver.rst doc: replace the import/export keywords for in/out 2022-06-14 15:39:48 +02:00
rpki.rst bgpd: Handle Origin Validation State extended community via route-map match 2022-09-04 21:54:47 +03:00
scripting.rst *: Fix spelling of overriden 2022-04-19 08:27:02 -04:00
setup.rst doc: Update setup.rst 2022-09-27 20:10:18 +05:30
sharp.rst doc: add docs for End.DT46 seg6local route 2022-10-18 16:08:24 +02:00
snmp.rst doc: remove 'no' form of commands 2021-02-22 14:38:21 -05:00
snmptrap.rst bgpd: Adjust symbolic names for cease notifications according to rfc4486 2022-01-06 10:07:41 +02:00
static.rst doc: Add missing static route options and clarify usage 2021-10-12 17:28:11 +02:00
subdir.am doc: Add the document for PIMv6 2022-03-10 02:12:54 -08:00
Useful_Sysctl_Settings.md doc: update VRF support description 2021-05-31 22:12:55 +03:00
vnc.rst doc: remove 'no' form of commands 2021-02-22 14:38:21 -05:00
vrrp.rst doc: remove 'no' form of commands 2021-02-22 14:38:21 -05:00
vtysh.rst doc: Align docs to recommend integrated config 2022-09-23 15:16:40 -04:00
watchfrr.rst doc: remove 'no' form of commands 2021-02-22 14:38:21 -05:00
wecmp_linkbw.rst doc: automatically generate index entries for cli 2021-02-22 14:38:21 -05:00
zebra.rst doc: extend documentation of SRv6 locator 2022-10-18 16:08:24 +02:00