zebra: Gather up output data and push in buffer to send
This commit gathers data from the client->obuf_fifo and
puts it all into the buffer for writing.
This will address the fact that the multiple events
created caused the memory of zebra to grow to
unrealistic levels of usage when we are redistributing
data to other protocols.
Recreate Memory:
robot# show memory
Memory statistics for zebra:
System allocator statistics:
Total heap allocated: 1930 MiB
Holding block headers: 16 MiB
Used small blocks: 0 bytes
Used ordinary blocks: 1911 MiB
Free small blocks: 1968 bytes
Free ordinary blocks: 19 MiB
Ordinary blocks: 5210
Small blocks: 58
Holding blocks: 1
New Zebra Memory:
Memory statistics for zebra:
System allocator statistics:
Total heap allocated: 478 MiB
Holding block headers: 16 MiB
Used small blocks: 0 bytes
Used ordinary blocks: 415 MiB
Free small blocks: 1968 bytes
Free ordinary blocks: 63 MiB
Ordinary blocks: 4909
Small blocks: 58
Holding blocks: 1
New show threads cpu for Zebra:
robot# show thread cpu
Thread statistics for zebra:
Showing statistics for pthread main
-----------------------------------
CPU (user+system): Real (wall-clock):
Active Runtime(ms) Invoked Avg uSec Max uSecs Avg uSec Max uSecs Type Thread
0 6465.766 801 8072 54775 10810 225356 T work_queue_run
1 0.096 4 24 37 24 38 R vtysh_accept
0 8.690 533 16 54 154 6286 W zserv_flush_data
0 254.102 290 876 2224 971 6958 W zserv_write
0 1992.936 7854 253 115333 266 116288 E &zserv_process_messages
1 1.351 6 225 245 226 249 R zebra_accept
1 0.152 8 19 22 19 23 T zebra_ptm_connect
1 0.124 7 17 24 18 24 R kernel_read
1 121.460 122 995 107273 1021 108707 R vtysh_read
6 686.460 7854 87 150 93 6006 R zserv_read
0 0.040 1 40 40 39 39 T zebra_route_map_update_timer
0 0.412 6 68 170 499 1520 T if_zebra_speed_update
Fixes: #2527 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>