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

[Choreo] Upstream connection handling support considering TCP and HTTP #3625

Open
wants to merge 3 commits into
base: choreo
Choose a base branch
from

Conversation

slahirucd7
Copy link
Contributor

Purpose

$subject
Relates with: https://github.com/wso2-enterprise/choreo/issues/32453

image

Issues

Fixes #

Automation tests

  • Unit tests added:No
  • Integration tests added: No

Tested environments

Not Tested


Maintainers: Check before merge

  • Assigned 'Type' label
  • Assigned the project
  • Validated respective github issues
  • Assigned milestone to the github issue(s)

@@ -129,6 +129,11 @@ func CreateRoutesWithClusters(mgwSwagger model.MgwSwagger, upstreamCerts map[str
if !strings.Contains(apiLevelEndpointProd.EndpointPrefix, xWso2EPClustersConfigNamePrefix) {
cluster, address, err := processEndpoints(apiLevelClusterNameProd, apiLevelEndpointProd,
upstreamCerts, timeout, apiLevelbasePath)
// assigns specified values for TCP keep-alive and HTTP timeout considering specific organizations
ok := slices.Contains(config.UpstreamConnectionConfEnabledOrgList, organizationID)
if ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • support

@@ -189,6 +189,20 @@ retainKeys = ["self_validate_jwt", "issuer", "claim_mappings", "consumer_key_cla
# Max interval for the Envoy's exponential retry back off algorithm
maxInterval = "500ms"

# TCP configurations applicable with the upstream clusters
[router.upstream.tCPConfigurations]

Choose a reason for hiding this comment

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

Suggested change
[router.upstream.tCPConfigurations]
[router.upstream.tcpConfigurations]

keepaliveIntervalInMillis = 75000

# HTTP configurations applicable with the upstream clusters
[router.upstream.hTTPConfigurations]

Choose a reason for hiding this comment

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

Suggested change
[router.upstream.hTTPConfigurations]
[router.upstream.httpConfigurations]

# HTTP configurations applicable with the upstream clusters
[router.upstream.hTTPConfigurations]
# Idle timeout in milliseconds for connections
idleTimeoutInMillis = 120000

Choose a reason for hiding this comment

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

This is too low for default. We have to set a value which is more than max response timeout (300s)

Suggested change
idleTimeoutInMillis = 120000
idleTimeoutInMillis = 360000

# Maximum number of keep-alive probes to send without response before deciding the connection is dead
keepaliveProbes = 9
# The number of milliseconds between keep-alive probes
keepaliveIntervalInMillis = 75000

Choose a reason for hiding this comment

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

Isn't this too high? Wouldn't something like 30s be better?

Suggested change
keepaliveIntervalInMillis = 75000
keepaliveIntervalInMillis = 30000

# The number of milliseconds a connection needs to be idle before keep-alive probes start being sent
keepaliveTimeInMillis = 120000
# Maximum number of keep-alive probes to send without response before deciding the connection is dead
keepaliveProbes = 9

Choose a reason for hiding this comment

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

Too high again?

Suggested change
keepaliveProbes = 9
keepaliveProbes = 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants