Commit 82b74253 authored by Maria Matějka's avatar Maria Matějka Committed by Maria Matejka
Browse files

Perf: Protocol to measure BIRD performance internally

This protocol is highly experimental and nobody should use it in
production. Anyway it may help you getting some insight into what eats
so much time in filter processing.
parent 78131eee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ if test "$enable_mpls_kernel" != no ; then
  fi
fi

all_protocols="$proto_bfd babel bgp mrt ospf pipe radv rip $proto_rpki static"
all_protocols="$proto_bfd babel bgp mrt ospf perf pipe radv rip $proto_rpki static"

all_protocols=`echo $all_protocols | sed 's/ /,/g'`

+49 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ configuration - something in config which is not keyword.
Ondrej Filip <it/&lt;feela@network.cz&gt;/,
Pavel Machek <it/&lt;pavel@ucw.cz&gt;/,
Martin Mares <it/&lt;mj@ucw.cz&gt;/,
Maria Jan Matejka <it/&lt;mq@jmq.cz&gt;/,
Maria Matejka <it/&lt;mq@jmq.cz&gt;/,
Ondrej Zajicek <it/&lt;santiago@crfreenet.org&gt;/
</author>

@@ -3759,6 +3759,54 @@ protocol ospf MyOSPF {
}
</code>

<sect>Perf
<label id="perf">

<sect1>Introduction
<label id="perf-intro">

<p>The Perf protocol is a generator of fake routes together with a time measurement
framework. Its purpose is to check BIRD performance and to benchmark filters.

<p>Import mode of this protocol runs in several steps. In each step, it generates 2^x routes,
imports them into the appropriate table and withdraws them. The exponent x is configurable.
It runs the benchmark several times for the same x, then it increases x by one
until it gets too high, then it stops.

<p>Export mode of this protocol repeats route refresh from table and measures how long it takes.

<p>Output data is logged on info level. There is a Perl script <cf>proto/perf/parse.pl</cf>
which may be handy to parse the data and draw some plots.

<p>Implementation of this protocol is experimental. Use with caution and do not keep
any instance of Perf in production configs for long time. The config interface is also unstable
and may change in future versions without warning.

<sect1>Configuration
<label id="perf-config">

<p><descrip>
	<tag><label id="perf-mode">mode import|export</tag>
	Set perf mode. Default: import

	<tag><label id="perf-repeat">repeat <m/number/</tag>
	Run this amount of iterations of the benchmark for every amount step. Default: 4

	<tag><label id="perf-from">exp from <m/number/</tag>
	Begin benchmarking on this exponent for number of generated routes in one step.
	Default: 10

	<tag><label id="perf-to">exp to <m/number/</tag>
	Stop benchmarking on this exponent. Default: 20

	<tag><label id="perf-threshold-min">threshold min <m/time/</tag>
	If a run for the given exponent took less than this time for route import,
	increase the exponent immediately. Default: 1 ms

	<tag><label id="perf-threshold-max">threshold max <m/time/</tag>
	If every run for the given exponent took at least this time for route import,
	stop benchmarking. Default: 500 ms
</descrip>

<sect>Pipe
<label id="pipe">
+3 −0
Original line number Diff line number Diff line
@@ -1379,6 +1379,9 @@ protos_build(void)
#ifdef CONFIG_RPKI
  proto_build(&proto_rpki);
#endif
#ifdef CONFIG_PERF
  proto_build(&proto_perf);
#endif

  proto_pool = rp_new(&root_pool, "Protocols");
  proto_shutdown_timer = tm_new(proto_pool);
+3 −1
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ enum protocol_class {
  PROTOCOL_KERNEL,
  PROTOCOL_OSPF,
  PROTOCOL_MRT,
  PROTOCOL_PERF,
  PROTOCOL_PIPE,
  PROTOCOL_RADV,
  PROTOCOL_RIP,
@@ -100,7 +101,8 @@ void protos_dump_all(void);

extern struct protocol
  proto_device, proto_radv, proto_rip, proto_static, proto_mrt,
  proto_ospf, proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki;
  proto_ospf, proto_perf,
  proto_pipe, proto_bgp, proto_bfd, proto_babel, proto_rpki;

/*
 *	Routing Protocol Instance
+2 −2
Original line number Diff line number Diff line
@@ -428,8 +428,8 @@ typedef struct rta {
#define RTS_PIPE 12			/* Inter-table wormhole */
#define RTS_BABEL 13			/* Babel route */
#define RTS_RPKI 14			/* Route Origin Authorization */
#define RTS_MAX 15

#define RTS_PERF 15			/* Perf checker */
#define RTS_MAX 16

#define RTC_UNICAST 0
#define RTC_BROADCAST 1
Loading