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

Support configurable interval to send TCP keepalive probes + Change to use port 80 as sample instead of port 8000 + Upgrade to v2.0.1 #4

Merged
merged 1 commit into from
Sep 13, 2022

Conversation

hansonchar
Copy link

@hansonchar hansonchar commented Sep 12, 2022

Issue #, if available:

I recently observed the following error when running the xks-proxy against a CloudHSM:

ERROR                 main hyper::server::tcp: accept error: Too many open files (os error 24)

Using lsof, I saw

sudo lsof -p 106586 | grep TCP | wc -l
1006

sudo lsof -p 106586 | grep TCP | grep ESTABLISHED | wc -l
1005

Apparently, the tcp keep-alive timeout is disabled by default in hyper:

https://github.com/hyperium/hyper/blob/0.14.x/src/server/tcp.rs#L66-L74

Description of changes:

  1. Support configurable interval to send TCP keepalive probes
  2. Change to use port 80 as sample instead of port 8000
  3. Upgrade to v2.0.1

Testing:

Testing with a 60 second interval to send TCP keepalive probes is in progress.

2022-09-12T00:14:47.563391Z  INFO main xks_proxy: v2.0.1 listening on 0.0.0.0:443
2022-09-12T00:14:47.564184Z  INFO main xks_proxy: TCP keepalive interval is set to 60 seconds

Will see if this change actually fixes the issue by running the patched server on the host that exhibited this failure before for a day or two.

watch `sudo lsof -p 129360 | grep TCP | grep ESTABLISHED | wc -l && sudo lsof -p 129360 | grep TCP | sort -k9 | grep ESTABLISHED`

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@hansonchar hansonchar requested a review from vsaiki September 12, 2022 00:52
@hansonchar
Copy link
Author

This issue is related to axum-server: Give more control on connection tasks #29

Change to use port 80 as sample instead of port 8000 +
Make use of structured data in logging +
Upgrade to v2.0.1

#4
pub struct ServerConfig {
pub ip: String,
pub port: u16,
pub region: String,
pub service: String,
pub ciphertext_metadata_b64: Option<String>,
// https://stackoverflow.com/questions/70184303/how-to-serialize-and-deserialize-chronoduration
Copy link
Collaborator

Choose a reason for hiding this comment

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

is there any issues with adding stack overflow links ?

Copy link
Author

Choose a reason for hiding this comment

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

I don't think so. This is open source and it's helpful to provide the source of info.

@hansonchar hansonchar merged commit 2461e29 into aws-samples:main Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants