From 3a7dc4818d5b4c35f9266ecbc50b42d4177d3e3f Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Mon, 6 May 2024 01:35:37 +0800 Subject: [PATCH 1/2] perf(webapi): Increase maxWorkers limit to 10000 Signed-off-by: Kevin Su --- flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go | 2 +- .../go/tasks/pluginmachinery/internal/webapi/core_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go index 1d0e31f71c..47d839ec25 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core.go @@ -21,7 +21,7 @@ const ( minCacheSize = 10 maxCacheSize = 500000 minWorkers = 1 - maxWorkers = 100 + maxWorkers = 10000 minSyncDuration = 5 * time.Second maxSyncDuration = time.Hour minBurst = 5 diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go index 65d90a6c7e..bad3f36667 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go @@ -52,7 +52,7 @@ func Test_validateConfig(t *testing.T) { err := validateConfig(cfg) assert.Error(t, err) - assert.Equal(t, "\ncache size is expected to be between 10 and 500000. Provided value is 0\nworkers count is expected to be between 1 and 100. Provided value is 0\nresync interval is expected to be between 5 and 3600. Provided value is 0\nread burst is expected to be between 5 and 10000. Provided value is 0\nread qps is expected to be between 1 and 100000. Provided value is 0\nwrite burst is expected to be between 5 and 10000. Provided value is 0\nwrite qps is expected to be between 1 and 100000. Provided value is 0", err.Error()) + assert.Equal(t, "\ncache size is expected to be between 10 and 500000. Provided value is 0\nworkers count is expected to be between 1 and 10000. Provided value is 0\nresync interval is expected to be between 5 and 3600. Provided value is 0\nread burst is expected to be between 5 and 10000. Provided value is 0\nread qps is expected to be between 1 and 100000. Provided value is 0\nwrite burst is expected to be between 5 and 10000. Provided value is 0\nwrite qps is expected to be between 1 and 100000. Provided value is 0", err.Error()) }) t.Run("Above max", func(t *testing.T) { From 7e14b69bb7f4a00c16169105cecd5917dd382b1e Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Mon, 6 May 2024 02:03:13 +0800 Subject: [PATCH 2/2] fix test Signed-off-by: Kevin Su --- .../go/tasks/pluginmachinery/internal/webapi/core_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go index bad3f36667..fe3fc69322 100644 --- a/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go +++ b/flyteplugins/go/tasks/pluginmachinery/internal/webapi/core_test.go @@ -74,7 +74,7 @@ func Test_validateConfig(t *testing.T) { err := validateConfig(cfg) assert.Error(t, err) - assert.Equal(t, "\ncache size is expected to be between 10 and 500000. Provided value is 1000000000\nworkers count is expected to be between 1 and 100. Provided value is 1000000000\nresync interval is expected to be between 5 and 3600. Provided value is 3.6e+07\nread burst is expected to be between 5 and 10000. Provided value is 1000000\nwrite burst is expected to be between 5 and 10000. Provided value is 1000000", err.Error()) + assert.Equal(t, "\ncache size is expected to be between 10 and 500000. Provided value is 1000000000\nworkers count is expected to be between 1 and 10000. Provided value is 1000000000\nresync interval is expected to be between 5 and 3600. Provided value is 3.6e+07\nread burst is expected to be between 5 and 10000. Provided value is 1000000\nwrite burst is expected to be between 5 and 10000. Provided value is 1000000", err.Error()) }) }