-
Notifications
You must be signed in to change notification settings - Fork 464
Add nginx timeouts #413
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
base: improve-kraken-origin-logging
Are you sure you want to change the base?
Add nginx timeouts #413
Conversation
4c3f228 to
58bfdd6
Compare
3d729cb to
100f8d0
Compare
58bfdd6 to
28f4b6f
Compare
dc6a30d to
0441c6d
Compare
gkeesh7
left a comment
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.
Please address the review comments and explain in detail what each config change does
config/agent/base.yaml
Outdated
|
|
||
| agentserver: | ||
| # Timeout configurations (also used by nginx) | ||
| download_timeout: 5m # nginx proxy_read_timeout for downloads |
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.
Let's keep it to 15 minutes
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.
Done
config/origin/base.yaml
Outdated
| addr: /tmp/kraken-origin.sock | ||
|
|
||
| # Timeout configurations (also used by nginx) | ||
| download_timeout: 5m # nginx proxy_read_timeout for downloads |
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.
15 minutes here as well
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.
Done
nginx/config/origin.go
Outdated
| proxy_send_timeout {{.upload_timeout}}; | ||
| proxy_read_timeout {{.download_timeout}}; | ||
| # Keepalive settings |
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.
Can you describe what is meant by these keep alive setting you are adding and why are they being added ?
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.
Added comments
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| } | ||
| # Special handling for upload operations with longer timeout |
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.
How will these addtional settings help ?
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.
As I understand the upload will happen ubuild -> kraken -> GCS, whereas replication will happen in between origin instances in out network, so I thought that it might have sense for splitting it, but if you think that there is not much sense in this I can put a single timeout.
nginx/nginx.go
Outdated
| return fmt.Sprintf("%ds", seconds) | ||
| } | ||
| // Fallback to milliseconds for very short durations | ||
| return fmt.Sprintf("%dms", bufferedDuration.Milliseconds()) |
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.
In line 256 we are already adding 30seconds Will we ever reach this codepath ?
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.
Made it convert to seconds only
| access_log {{.access_log_path}}; | ||
| error_log {{.error_log_path}}; | ||
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.
Same here as well please describe in more detail
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.
Added comments
| return addr | ||
| } | ||
|
|
||
| func FormatDurationForNginx(d time.Duration) string { |
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.
Please explain the purpose o fthis function
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.
Added documentation
|
@hweawer can you rebase the changes and run against the updated CI ? |
🛠 Technical Implementation
🎁 Benefits