set stream parser throttle

This commit is contained in:
Annika Hannig 2023-05-26 11:50:07 +02:00
parent d0779320e3
commit ac5b8b8287
No known key found for this signature in database
GPG Key ID: 62E226E47DDCE58D
3 changed files with 13 additions and 0 deletions

View File

@ -82,6 +82,7 @@ type ServerConfig struct {
StoreBackend string `ini:"store_backend"` StoreBackend string `ini:"store_backend"`
Asn int `ini:"asn"` Asn int `ini:"asn"`
EnableNeighborsStatusRefresh bool `ini:"enable_neighbors_status_refresh"` EnableNeighborsStatusRefresh bool `ini:"enable_neighbors_status_refresh"`
StreamParserThrottle int `ini:"stream_parser_throttle"`
} }
// PostgresConfig is the configuration for the database // PostgresConfig is the configuration for the database
@ -884,6 +885,13 @@ func LoadConfig(file string) (*Config, error) {
return nil, err return nil, err
} }
// Update stream parser throttle on all birdwatcher sources
for _, src := range sources {
if src.Backend == SourceBackendBirdwatcher {
src.Birdwatcher.StreamParserThrottle = server.StreamParserThrottle
}
}
config := &Config{ config := &Config{
Server: server, Server: server,
Postgres: psql, Postgres: psql,

View File

@ -69,6 +69,9 @@ func TestSourceConfig(t *testing.T) {
if rs2.Birdwatcher.AltPipeProtocolSuffix != "_lg" { if rs2.Birdwatcher.AltPipeProtocolSuffix != "_lg" {
t.Error("unexpected alt_pipe_suffix:", rs2.Birdwatcher.AltPipeProtocolSuffix) t.Error("unexpected alt_pipe_suffix:", rs2.Birdwatcher.AltPipeProtocolSuffix)
} }
if rs2.Birdwatcher.StreamParserThrottle != 2342 {
t.Error("Unexpected StreamParserThrottle", rs2.Birdwatcher.StreamParserThrottle)
}
} }
nilGoBGPConfig := gobgp.Config{} nilGoBGPConfig := gobgp.Config{}
if rs3.GoBGP == nilGoBGPConfig { if rs3.GoBGP == nilGoBGPConfig {

View File

@ -25,6 +25,8 @@ neighbors_store_refresh_parallelism = 10000
routes_store_refresh_interval = 5 routes_store_refresh_interval = 5
neighbors_store_refresh_interval = 5 neighbors_store_refresh_interval = 5
stream_parser_throttle = 2342
store_backend = postgres store_backend = postgres
[postgres] [postgres]