Skip to content

Follow up on DefaultEndpointResolver in the orchestrator #2592

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

Merged
merged 7 commits into from
Apr 21, 2023

Conversation

ysaito1001
Copy link
Contributor

Motivation and Context

This PR incorporates post-merge feedback left in #2577.


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

@ysaito1001 ysaito1001 requested a review from a team as a code owner April 18, 2023 20:10
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@ysaito1001 ysaito1001 requested a review from jdisanti April 19, 2023 14:37
@ysaito1001 ysaito1001 requested a review from jdisanti April 19, 2023 23:36
@ysaito1001 ysaito1001 enabled auto-merge April 21, 2023 15:40
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

@ysaito1001 ysaito1001 added this pull request to the merge queue Apr 21, 2023
@github-actions
Copy link

A new generated diff is ready to view.

  • AWS SDK (ignoring whitespace)
  • No codegen difference in the Client Test
  • No codegen difference in the Server Test
  • No codegen difference in the Server Test Python
  • No codegen difference in the Server Test Typescript

A new doc preview is ready to view.

Merged via the queue into main with commit 3d8c52a Apr 21, 2023
@ysaito1001 ysaito1001 deleted the ysaito/follow-up-on-default-ep-resolver branch April 21, 2023 17:41
ysaito1001 added a commit that referenced this pull request Apr 21, 2023
This commit ports fixes made in #2592, which addresses the following
#2577 (comment)
ysaito1001 added a commit that referenced this pull request Apr 21, 2023
…2620)

## Motivation and Context
Addresses
#2593 (comment)
and
#2593 (comment).

Also ports the changes made in #2592.

## Description
Prior to this PR, `sra_manual_test` and the bench
`middleware_vs_orchestrator` created `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` every time a request for
`ListObjectsV2` was dispatched. This is not the case in production where
those two types are created once during the construction of a service
config
([here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L623-L625)
and
[here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L635-L652))
and reused for subsequent request dispatches.

The PR will make `sra_manual_test` and `middleware_vs_orchestrator` do
the same, creating `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` only once before the
test/benchmark starts running and reusing them thereafter.

The change will help bring the performance for `orchestrator` closer to
that for `middleware`.

- In the `main` branch with `DefaultEndpointResolver` commented in and
`StaticUriEndpointResolver` commented out:
```
middleware              time:   [20.924 µs 20.943 µs 20.964 µs]
                        change: [-1.0107% -0.7357% -0.4827%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe

orchestrator            time:   [933.68 µs 940.11 µs 945.82 µs]
                        change: [+2735.7% +2754.5% +2770.9%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  14 (14.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe
```

- With the change in this PR:
```
middleware              time:   [21.161 µs 21.194 µs 21.232 µs]
                        change: [-0.8973% -0.6397% -0.3758%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

orchestrator            time:   [56.038 µs 56.182 µs 56.349 µs]
                        change: [-0.7921% -0.5552% -0.3157%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

```


## Testing
Executed the following without any errors:
```
➜  smithy-rs git:(ysaito/create-creds-cache-and-ep-resolver-only-once) ✗ ./gradlew aws:sra-test:assemble
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo t
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo bench
```

----

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

---------

Co-authored-by: Yuki Saito <[email protected]>
unexge pushed a commit that referenced this pull request Apr 24, 2023
## Motivation and Context
This PR incorporates post-merge feedback left in #2577.

----

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

---------

Co-authored-by: Yuki Saito <[email protected]>
unexge pushed a commit that referenced this pull request Apr 24, 2023
…2620)

## Motivation and Context
Addresses
#2593 (comment)
and
#2593 (comment).

Also ports the changes made in #2592.

## Description
Prior to this PR, `sra_manual_test` and the bench
`middleware_vs_orchestrator` created `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` every time a request for
`ListObjectsV2` was dispatched. This is not the case in production where
those two types are created once during the construction of a service
config
([here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L623-L625)
and
[here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L635-L652))
and reused for subsequent request dispatches.

The PR will make `sra_manual_test` and `middleware_vs_orchestrator` do
the same, creating `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` only once before the
test/benchmark starts running and reusing them thereafter.

The change will help bring the performance for `orchestrator` closer to
that for `middleware`.

- In the `main` branch with `DefaultEndpointResolver` commented in and
`StaticUriEndpointResolver` commented out:
```
middleware              time:   [20.924 µs 20.943 µs 20.964 µs]
                        change: [-1.0107% -0.7357% -0.4827%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe

orchestrator            time:   [933.68 µs 940.11 µs 945.82 µs]
                        change: [+2735.7% +2754.5% +2770.9%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  14 (14.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe
```

- With the change in this PR:
```
middleware              time:   [21.161 µs 21.194 µs 21.232 µs]
                        change: [-0.8973% -0.6397% -0.3758%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

orchestrator            time:   [56.038 µs 56.182 µs 56.349 µs]
                        change: [-0.7921% -0.5552% -0.3157%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

```


## Testing
Executed the following without any errors:
```
➜  smithy-rs git:(ysaito/create-creds-cache-and-ep-resolver-only-once) ✗ ./gradlew aws:sra-test:assemble
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo t
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo bench
```

----

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

---------

Co-authored-by: Yuki Saito <[email protected]>
rcoh pushed a commit that referenced this pull request Apr 24, 2023
## Motivation and Context
This PR incorporates post-merge feedback left in #2577.

----

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

---------

Co-authored-by: Yuki Saito <[email protected]>
rcoh pushed a commit that referenced this pull request Apr 24, 2023
…2620)

## Motivation and Context
Addresses
#2593 (comment)
and
#2593 (comment).

Also ports the changes made in #2592.

## Description
Prior to this PR, `sra_manual_test` and the bench
`middleware_vs_orchestrator` created `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` every time a request for
`ListObjectsV2` was dispatched. This is not the case in production where
those two types are created once during the construction of a service
config
([here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L623-L625)
and
[here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/s3/src/config.rs#L635-L652))
and reused for subsequent request dispatches.

The PR will make `sra_manual_test` and `middleware_vs_orchestrator` do
the same, creating `CredentialsCache` and
`aws_sdk_s3::endpoint::DefaultResolver` only once before the
test/benchmark starts running and reusing them thereafter.

The change will help bring the performance for `orchestrator` closer to
that for `middleware`.

- In the `main` branch with `DefaultEndpointResolver` commented in and
`StaticUriEndpointResolver` commented out:
```
middleware              time:   [20.924 µs 20.943 µs 20.964 µs]
                        change: [-1.0107% -0.7357% -0.4827%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 7 outliers among 100 measurements (7.00%)
  1 (1.00%) high mild
  6 (6.00%) high severe

orchestrator            time:   [933.68 µs 940.11 µs 945.82 µs]
                        change: [+2735.7% +2754.5% +2770.9%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 17 outliers among 100 measurements (17.00%)
  14 (14.00%) low mild
  2 (2.00%) high mild
  1 (1.00%) high severe
```

- With the change in this PR:
```
middleware              time:   [21.161 µs 21.194 µs 21.232 µs]
                        change: [-0.8973% -0.6397% -0.3758%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 8 outliers among 100 measurements (8.00%)
  5 (5.00%) high mild
  3 (3.00%) high severe

orchestrator            time:   [56.038 µs 56.182 µs 56.349 µs]
                        change: [-0.7921% -0.5552% -0.3157%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 5 outliers among 100 measurements (5.00%)
  2 (2.00%) high mild
  3 (3.00%) high severe

```


## Testing
Executed the following without any errors:
```
➜  smithy-rs git:(ysaito/create-creds-cache-and-ep-resolver-only-once) ✗ ./gradlew aws:sra-test:assemble
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo t
➜  aws-sdk-s3 git:(ysaito/create-creds-cache-and-ep-resolver-only-once) cargo bench
```

----

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

---------

Co-authored-by: Yuki Saito <[email protected]>
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.

3 participants