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

Adjust the read and write timeout configuration of the http server #2171

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions api/internal/core/server/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (s *server) setupAPI() {
s.server = &http.Server{
Addr: addr,
Handler: r,
ReadTimeout: time.Duration(1000) * time.Millisecond,
WriteTimeout: time.Duration(5000) * time.Millisecond,
ReadTimeout: time.Duration(5000) * time.Millisecond,
WriteTimeout: time.Duration(60000) * time.Millisecond,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need to change the WriteTimeout here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be changed to add gzip middleware. It will greatly reduce the volume of transferred files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be changed to add gzip middleware. It will greatly reduce the volume of transferred files.

+1. And I'm happy to update the code.

}

// HTTPS
Expand All @@ -60,8 +60,8 @@ func (s *server) setupAPI() {
s.serverSSL = &http.Server{
Addr: addrSSL,
Handler: r,
ReadTimeout: time.Duration(1000) * time.Millisecond,
WriteTimeout: time.Duration(5000) * time.Millisecond,
ReadTimeout: time.Duration(5000) * time.Millisecond,
WriteTimeout: time.Duration(60000) * time.Millisecond,
TLSConfig: &tls.Config{
// Causes servers to use Go's default ciphersuite preferences,
// which are tuned to avoid attacks. Does nothing on clients.
Expand Down