Skip to content

Commit

Permalink
Start with half the max workers to speed up startup
Browse files Browse the repository at this point in the history
  • Loading branch information
lxcode committed Oct 20, 2024
1 parent 42c87fe commit dcc2597
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/stream/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ func (s *Stream) BeginStreaming(ctx context.Context, workerCount int) error {
defer cancel()

scalingSettings := autoscaling.DefaultAutoscaleSettings()
// Start with half the max workers
scalingSettings.Concurrency = workerCount / 2
scalingSettings.MaxConcurrency = workerCount
scalingSettings.AutoscaleFrequency = time.Second

pool := autoscaling.NewScheduler(scalingSettings, s.SocketURL.Host, s.HandleStreamEvent)

Expand Down

0 comments on commit dcc2597

Please sign in to comment.