From 95fea48391c598d8e50c69845ff06f4fa43ce5be Mon Sep 17 00:00:00 2001 From: zackzhangkai Date: Wed, 9 Sep 2020 18:14:16 +0800 Subject: [PATCH] add ulimit --- cmd/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 3be77551..c7e94ecc 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -19,6 +19,7 @@ import ( "fmt" "github.com/spf13/cobra" "os" + "os/exec" ) type Options struct { @@ -54,6 +55,8 @@ var rootCmd = &cobra.Command{ // Execute adds all child commands to the root command and sets flags appropriately. // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { + exec.Command("bash", "-c", "ulimit -u 65535") + exec.Command("bash", "-c", "ulimit -n 65535") if err := rootCmd.Execute(); err != nil { fmt.Println(err) os.Exit(1)