mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
[management] use account request buffer on sync (#3229)
This commit is contained in:
parent
eb2ac039c7
commit
2605948e01
@ -3005,6 +3005,8 @@ func peerShouldReceiveUpdate(t *testing.T, updateMessage <-chan *UpdateMessage)
|
||||
}
|
||||
|
||||
func BenchmarkSyncAndMarkPeer(b *testing.B) {
|
||||
b.Setenv("NB_GET_ACCOUNT_BUFFER_INTERVAL", "0")
|
||||
|
||||
benchCases := []struct {
|
||||
name string
|
||||
peers int
|
||||
@ -3015,10 +3017,10 @@ func BenchmarkSyncAndMarkPeer(b *testing.B) {
|
||||
minMsPerOpCICD float64
|
||||
maxMsPerOpCICD float64
|
||||
}{
|
||||
{"Small", 50, 5, 1, 3, 3, 19},
|
||||
{"Medium", 500, 100, 7, 13, 10, 90},
|
||||
{"Large", 5000, 200, 65, 80, 60, 240},
|
||||
{"Small single", 50, 10, 1, 3, 3, 80},
|
||||
{"Small", 50, 5, 1, 5, 3, 19},
|
||||
{"Medium", 500, 100, 7, 22, 10, 90},
|
||||
{"Large", 5000, 200, 65, 110, 60, 240},
|
||||
{"Small single", 50, 10, 1, 4, 3, 80},
|
||||
{"Medium single", 500, 10, 7, 13, 10, 37},
|
||||
{"Large 5", 5000, 15, 65, 80, 60, 220},
|
||||
}
|
||||
@ -3072,6 +3074,7 @@ func BenchmarkSyncAndMarkPeer(b *testing.B) {
|
||||
}
|
||||
|
||||
func BenchmarkLoginPeer_ExistingPeer(b *testing.B) {
|
||||
b.Setenv("NB_GET_ACCOUNT_BUFFER_INTERVAL", "0")
|
||||
benchCases := []struct {
|
||||
name string
|
||||
peers int
|
||||
@ -3082,12 +3085,12 @@ func BenchmarkLoginPeer_ExistingPeer(b *testing.B) {
|
||||
minMsPerOpCICD float64
|
||||
maxMsPerOpCICD float64
|
||||
}{
|
||||
{"Small", 50, 5, 102, 110, 3, 20},
|
||||
{"Medium", 500, 100, 105, 140, 20, 110},
|
||||
{"Large", 5000, 200, 160, 200, 120, 260},
|
||||
{"Small single", 50, 10, 102, 110, 5, 40},
|
||||
{"Medium single", 500, 10, 105, 140, 10, 60},
|
||||
{"Large 5", 5000, 15, 160, 200, 60, 180},
|
||||
{"Small", 50, 5, 2, 10, 3, 35},
|
||||
{"Medium", 500, 100, 5, 40, 20, 110},
|
||||
{"Large", 5000, 200, 60, 100, 120, 260},
|
||||
{"Small single", 50, 10, 2, 10, 5, 40},
|
||||
{"Medium single", 500, 10, 5, 40, 10, 60},
|
||||
{"Large 5", 5000, 15, 60, 100, 60, 180},
|
||||
}
|
||||
|
||||
log.SetOutput(io.Discard)
|
||||
@ -3146,6 +3149,7 @@ func BenchmarkLoginPeer_ExistingPeer(b *testing.B) {
|
||||
}
|
||||
|
||||
func BenchmarkLoginPeer_NewPeer(b *testing.B) {
|
||||
b.Setenv("NB_GET_ACCOUNT_BUFFER_INTERVAL", "0")
|
||||
benchCases := []struct {
|
||||
name string
|
||||
peers int
|
||||
@ -3156,12 +3160,12 @@ func BenchmarkLoginPeer_NewPeer(b *testing.B) {
|
||||
minMsPerOpCICD float64
|
||||
maxMsPerOpCICD float64
|
||||
}{
|
||||
{"Small", 50, 5, 107, 120, 10, 80},
|
||||
{"Medium", 500, 100, 105, 140, 30, 140},
|
||||
{"Large", 5000, 200, 180, 220, 140, 300},
|
||||
{"Small single", 50, 10, 107, 120, 10, 80},
|
||||
{"Medium single", 500, 10, 105, 140, 20, 60},
|
||||
{"Large 5", 5000, 15, 180, 220, 80, 200},
|
||||
{"Small", 50, 5, 7, 20, 10, 80},
|
||||
{"Medium", 500, 100, 5, 40, 30, 140},
|
||||
{"Large", 5000, 200, 80, 120, 140, 300},
|
||||
{"Small single", 50, 10, 7, 20, 10, 80},
|
||||
{"Medium single", 500, 10, 5, 40, 20, 60},
|
||||
{"Large 5", 5000, 15, 80, 120, 80, 200},
|
||||
}
|
||||
|
||||
log.SetOutput(io.Discard)
|
||||
|
@ -145,14 +145,14 @@ func BenchmarkGetAllPeers(b *testing.B) {
|
||||
|
||||
func BenchmarkDeletePeer(b *testing.B) {
|
||||
var expectedMetrics = map[string]testing_tools.PerformanceMetrics{
|
||||
"Peers - XS": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Peers - S": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Peers - M": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Peers - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Groups - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Users - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Setup Keys - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Peers - XL": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 16},
|
||||
"Peers - XS": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Peers - S": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Peers - M": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Peers - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Groups - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Users - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Setup Keys - L": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
"Peers - XL": {MinMsPerOpLocal: 0, MaxMsPerOpLocal: 4, MinMsPerOpCICD: 2, MaxMsPerOpCICD: 18},
|
||||
}
|
||||
|
||||
log.SetOutput(io.Discard)
|
||||
|
@ -989,7 +989,7 @@ func (am *DefaultAccountManager) getValidatedPeerWithMap(ctx context.Context, is
|
||||
return peer, emptyMap, nil, nil
|
||||
}
|
||||
|
||||
account, err := am.Store.GetAccount(ctx, accountID)
|
||||
account, err := am.requestBuffer.GetAccountWithBackpressure(ctx, accountID)
|
||||
if err != nil {
|
||||
return nil, nil, nil, err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user