Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase default timeouts for read-write operations and edit the values in the example config file. #244

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cmd/neofs-rest-gw/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func config() *viper.Viper {
flagSet.String(cfgTLSCertFile, "", "TLS certificate file to use; note that if you want to start HTTPS server, you should also set up --"+cmdListenAddress+" and --"+cfgTLSKeyFile)
flagSet.String(cfgTLSKeyFile, "", "TLS key file to use; note that if you want to start HTTPS server, you should also set up --"+cmdListenAddress+" and --"+cfgTLSCertFile)
flagSet.Duration(cfgEndpointKeepAlive, 3*time.Minute, "sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)")
flagSet.Duration(cfgEndpointReadTimeout, 30*time.Second, "maximum duration before timing out read of the request")
flagSet.Duration(cfgEndpointWriteTimeout, 30*time.Second, "maximum duration before timing out write of the response")
flagSet.Duration(cfgEndpointReadTimeout, 60*time.Second, "maximum duration before timing out read of the request")
flagSet.Duration(cfgEndpointWriteTimeout, 60*time.Second, "maximum duration before timing out write of the response")
flagSet.String(cfgEndpointExternalAddress, "", "the full URL address needs to be shown in the API documentation")

// init server flags
Expand Down Expand Up @@ -449,7 +449,7 @@ func newLogger(v *viper.Viper) *zap.Logger {
}

l, err := c.Build(
zap.AddStacktrace(zap.NewAtomicLevelAt(zap.FatalLevel)),
zap.AddStacktrace(zap.NewAtomicLevelAt(zapcore.FatalLevel)),
)
if err != nil {
panic(fmt.Sprintf("build zap logger instance: %v", err))
Expand Down
6 changes: 3 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ logger:

pool:
# Timeout to dial node.
node-dial-timeout: 5s
node-dial-timeout: 10s
# Timeout to check node health during rebalance.
healthcheck-timeout: 5s
# Interval to check nodes' health.
Expand Down Expand Up @@ -73,9 +73,9 @@ server:
# It prunes dead TCP connections ( e.g. closing laptop mid-download).
keep-alive: 3m
# Maximum duration before timing out read of the request.
read-timeout: 30s
read-timeout: 60s
# Maximum duration before timing out write of the response.
write-timeout: 30s
write-timeout: 60s

- address: localhost:8080
external-address: http://localhost:8090
Expand Down
8 changes: 4 additions & 4 deletions docs/gate-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ server:
key: /path/to/tls/key
ca-certificate: /path/to/tls/ca
keep-alive: 3m
read-timeout: 30s
write-timeout: 30s
read-timeout: 60s
write-timeout: 60s
cleanup-timeout: 10s
graceful-timeout: 15s
max-header-size: 1000000
Expand All @@ -48,8 +48,8 @@ server:
| `listen-limit` | `int` | `0` | Limit the number of outstanding requests. `0` means no limit | |
| `endpoint.[0].address` | `string` | `localhost:8080` | The IP and port to listen on. |
| `endpoint.[0].keep-alive` | `duration` | `3m` | Sets the TCP keep-alive timeouts on accepted connections. |
| `endpoint.[0].read-timeout` | `duration` | `30s` | Maximum duration before timing out read of the request. It prunes dead TCP connections (e.g. closing laptop mid-download). |
| `endpoint.[0].write-timeout` | `duration` | `30s` | Maximum duration before timing out write of the response. |
| `endpoint.[0].read-timeout` | `duration` | `60s` | Maximum duration before timing out read of the request. It prunes dead TCP connections (e.g. closing laptop mid-download). |
| `endpoint.[0].write-timeout` | `duration` | `60s` | Maximum duration before timing out write of the response. |
| `endpoint.[0].tls.enabled` | `bool` | `false` | Use TLS for a gRPC connection (min version is TLS 1.2). |
| `endpoint.[0].tls.certificate` | `string` | | The certificate file to use for secure connections. |
| `endpoint.[0].tls.key` | `string` | | The private key file to use for secure connections (without passphrase). |
Expand Down
Loading