File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -84,9 +84,12 @@ func InitConfig() {
8484 m , _ := mem .VirtualMemory ()
8585 if m != nil {
8686 conf .MaxBufferLimit = max (int (float64 (m .Total )* 0.05 ), 4 * utils .MB )
87+ conf .MaxBufferLimit -= conf .MaxBufferLimit % utils .MB
8788 } else {
8889 conf .MaxBufferLimit = 16 * utils .MB
8990 }
91+ } else {
92+ conf .MaxBufferLimit = conf .Conf .MaxBufferLimit * utils .MB
9093 }
9194 log .Infof ("max buffer limit: %d" , conf .MaxBufferLimit )
9295 if ! conf .Conf .Force {
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ type Config struct {
119119 DistDir string `json:"dist_dir"`
120120 Log LogConfig `json:"log" envPrefix:"LOG_"`
121121 DelayedStart int `json:"delayed_start" env:"DELAYED_START"`
122- MaxBufferLimit int `json:"max_buffer_limit " env:"MAX_BUFFER_LIMIT "`
122+ MaxBufferLimit int `json:"max_buffer_limitMB " env:"MAX_BUFFER_LIMIT_MB "`
123123 MaxConnections int `json:"max_connections" env:"MAX_CONNECTIONS"`
124124 MaxConcurrency int `json:"max_concurrency" env:"MAX_CONCURRENCY"`
125125 TlsInsecureSkipVerify bool `json:"tls_insecure_skip_verify" env:"TLS_INSECURE_SKIP_VERIFY"`
You can’t perform that action at this time.
0 commit comments