-
Notifications
You must be signed in to change notification settings - Fork 542
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
Conversation
… that the dashboard can work normally in a slow network environment.
Codecov Report
@@ Coverage Diff @@
## master #2171 +/- ##
==========================================
- Coverage 69.34% 65.92% -3.43%
==========================================
Files 188 188
Lines 7161 7161
Branches 823 823
==========================================
- Hits 4966 4721 -245
- Misses 1906 2153 +247
+ Partials 289 287 -2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
cc @nic-chen |
hi, @nic-6443 which file is so large? |
The front-end static files from the
|
60 seconds seems a bit too long, can we compress the size of the JS file |
hi, @bzp2010 |
60s refers to the default value of |
Should we add custom configuration timeouts? Allow low bandwidth users access, public network configuration can be limited to IP. |
@nic-6443 we could support configure them in |
I think it's ok, but I still insist the default value can be larger so that users will not easily encounter problems when using it for the first time, just like me.Especially when there is no obvious risk of increasing timeout. |
My advice is to consider how to compress js files first, and if there is no way to compress them, then discuss increasing the default timeout |
ok, no problem |
ReadTimeout: time.Duration(1000) * time.Millisecond, | ||
WriteTimeout: time.Duration(5000) * time.Millisecond, | ||
ReadTimeout: time.Duration(5000) * time.Millisecond, | ||
WriteTimeout: time.Duration(60000) * time.Millisecond, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@nic-6443 Would you like to try using gin |
I can do it, do I need a new pull request? |
Why submit this pull request?
What changes will this PR take into?
Adjust the
read
andwrite
timeout configuration of the http server so that the Dashboard can work normally in a slow network environment. Especially write timeout, because the Dashboard has a relatively large front-end static resource file (>2M). When the bandwidth is limited It is easy to trigger the timeout in the scene, which will cause the page display to fail.Related issues
fix/resolve #2165
Checklist: