Skip to content

Commit

Permalink
ベンチの並列数調整 基本1, viewer * 10
Browse files Browse the repository at this point in the history
  • Loading branch information
fujiwara committed Nov 23, 2023
1 parent 4fe3623 commit 60b6e3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions bench/cmd/bench/benchmarker.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ func newBenchmarker(ctx context.Context, contestantLogger *zap.Logger) *benchmar
streamerSem: semaphore.NewWeighted(weight),
longStreamerSem: semaphore.NewWeighted(weight),
moderatorSem: semaphore.NewWeighted(weight),
viewerSem: semaphore.NewWeighted(weight * 1), // 配信者の10倍視聴者トラフィックがある
spammerSem: semaphore.NewWeighted(weight * 2), // 視聴者の2倍はスパム投稿者が潜んでいる
attackSem: semaphore.NewWeighted(512), // 攻撃を段階的に大きくする最大値
viewerSem: semaphore.NewWeighted(weight * 10), // 配信者の10倍視聴者トラフィックがある
spammerSem: semaphore.NewWeighted(weight * 2), // 視聴者の2倍はスパム投稿者が潜んでいる
attackSem: semaphore.NewWeighted(512), // 攻撃を段階的に大きくする最大値
attackParallelis: 2,
streamerLoginSem: semaphore.NewWeighted(weight),
streamerLoginCounter: new(LoginCounter),
Expand Down
2 changes: 1 addition & 1 deletion bench/internal/config/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TooManySpamThresholdPercentage = 30.0

// 基本となる並列性
// セマフォの重みに使われます
const BaseParallelism = 10
const BaseParallelism = 1

// 動的に並列度を上げる並列性
// スコアに直結する視聴者シナリオなどのセマフォの重みに使われます
Expand Down

0 comments on commit 60b6e3a

Please sign in to comment.