frr/vtysh
Srujana 9112fb367b lib: Memory spike reduction for sh cmds at scale
The output buffer vty->obuf is a linked list where
each element is of 4KB.
Currently, when a huge sh command  like <show ip route json>
is executed on a large scale, all the vty_outs are
processed and the entire data is accumulated.
After the entire vty execution, vtysh_flush proceeses
and puts this data in the socket (131KB at a time).

Problem here is the memory spike for such heavy duty
show commands.

The fix here is to chunkify the output on VTY shell by
flushing it intermediately for every 128 KB of output
accumulated and free the memory allocated for the buffer data.

This way, we achieve ~25-30% reduction in the memory spike.

Fixes: #16498
Note: This is a continuation of MR #16498

Signed-off-by: Srujana <skanchisamud@nvidia.com>

Signed-off-by: Rajasekar Raja <rajasekarr@nvidia.com>
2024-08-27 12:47:00 -07:00
..
.gitignore vtysh, lib: preprocess CLI graphs 2024-07-31 08:08:53 -04:00
daemons.pl *: manual SPDX License ID conversions 2023-02-09 14:09:07 +01:00
Makefile build: non-recursive vtysh 2018-09-08 21:26:54 +02:00
subdir.am vtysh, lib: preprocess CLI graphs 2024-07-31 08:08:53 -04:00
vtysh.c lib: Memory spike reduction for sh cmds at scale 2024-08-27 12:47:00 -07:00
vtysh.h lib: Memory spike reduction for sh cmds at scale 2024-08-27 12:47:00 -07:00
vtysh_config.c pimd, lib, vtysh: Added new 'router pim[6] [vrf NAME]' config node 2024-07-16 13:30:35 -05:00
vtysh_main.c vtysh: de-conditionalize and reorder install_node 2024-07-31 08:08:53 -04:00
vtysh_user.c vtysh: Give actual pam error messages 2023-05-26 07:44:11 -04:00
vtysh_user.h *: auto-convert to SPDX License IDs 2023-02-09 14:09:11 +01:00