Skip to content

Commit

Permalink
experimental: Implement real reconciler for LB tables
Browse files Browse the repository at this point in the history
FIXME split this up further

Signed-off-by: Jussi Maki <jussi@isovalent.com>
  • Loading branch information
joamaki committed Jul 10, 2024
1 parent 3a21748 commit 6c7a839
Show file tree
Hide file tree
Showing 13 changed files with 2,334 additions and 325 deletions.
25 changes: 5 additions & 20 deletions pkg/loadbalancer/experimental/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,28 +113,12 @@ func BenchmarkInsertBackend(b *testing.B) {
)
wtxn.Commit()

numObjects := 1000

// Add 'numObjects' existing objects to the table.
wtxn = p.Writer.WriteTxn()
for i := 0; i < numObjects; i++ {
beAddr := *loadbalancer.NewL3n4Addr(loadbalancer.TCP, addrCluster1, uint16(i), loadbalancer.ScopeExternal)
p.Writer.UpsertBackends(
wtxn,
name,
source.Kubernetes,
&loadbalancer.Backend{
L3n4Addr: beAddr,
State: loadbalancer.BackendStateActive,
},
)
}
wtxn.Commit()

b.ResetTimer()

// Benchmark the speed at which a new backend is upserted. 'numObjects' are inserted in one
// WriteTxn to amortize the cost of WriteTxn&Commit.
// Create 100 backends for the single service & frontend to benchmark a more extreme
// case.
numObjects := 100

for n := 0; n < b.N; n++ {
wtxn = p.Writer.WriteTxn()
for i := 0; i < numObjects; i++ {
Expand All @@ -156,6 +140,7 @@ func BenchmarkInsertBackend(b *testing.B) {
b.StopTimer()
b.ReportMetric(float64(b.N*numObjects)/b.Elapsed().Seconds(), "objects/sec")
}

func BenchmarkReplaceBackend(b *testing.B) {
p := fixture(b)

Expand Down
Loading

0 comments on commit 6c7a839

Please sign in to comment.