Skip to content

Conversation

jasdel
Copy link
Contributor

@jasdel jasdel commented Jun 6, 2018

Updates the Credentials type's cache of the CredentialsValue to be
synchronized with an atomic value in addition to the Mutex. This reduces
the overhead applications will encounter when many concurrent API
requests are being made.

Benchmarks of SafeCredentialsProvider.Retrieve improvements. This will
be the normal case until credentials expire. Each benchmark increases
the number of concurrent credential retrieves.

benchmark                                                              old ns/op     new ns/op     delta
BenchmarkSafeCredentialsProvider_Retrieve/1-4                          72.3          26.1          -63.90%
BenchmarkSafeCredentialsProvider_Retrieve/10-4                         1055          121           -88.53%
BenchmarkSafeCredentialsProvider_Retrieve/100-4                        15720         1216          -92.26%
BenchmarkSafeCredentialsProvider_Retrieve/500-4                        65662         6194          -90.57%
BenchmarkSafeCredentialsProvider_Retrieve/1000-4                       121962        12673         -89.61%
BenchmarkSafeCredentialsProvider_Retrieve/10000-4                      9958536       127224        -98.72%

Benchmark of SafeCredentialsProvider.Retrieve with the credentials
periodically expiring. The {rate}-{concurrent} benchmarks will expire
the credentials every {rate} attempts to get credentials, with
{concurrent} credential getters.

benchmark                                                              old ns/op     new ns/op     delta
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-1-4         223           171           -23.32%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-10-4        1527          313           -79.50%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-100-4       14528         1779          -87.75%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-500-4       89016         7764          -91.28%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-1000-4      151669        14048         -90.74%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-10000-4     10024041      201702        -97.99%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-1-4          1450          1423          -1.86%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-10-4         3043          1483          -51.27%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-100-4        24763         2956          -88.06%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-500-4        68852         8801          -87.22%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-1000-4       121360        15952         -86.86%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-10000-4      2133773       177960        -91.66%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-1-4           13688         13012         -4.94%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-10-4          15560         13239         -14.92%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-100-4         35299         15879         -55.02%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-500-4         110204        20949         -80.99%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-1000-4        259354        31070         -88.02%
BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-10000-4       7847174       196509        -97.50%

Related to: aws/aws-sdk-go#1973

@jasdel jasdel self-assigned this Jun 6, 2018
@jasdel jasdel requested a review from xibz June 6, 2018 20:03
@jasdel jasdel force-pushed the enc/CredsRWLock branch from f7c2065 to fd6cb23 Compare June 6, 2018 20:19
xibz
xibz previously approved these changes Jun 6, 2018
Copy link
Contributor

@xibz xibz left a comment

Choose a reason for hiding this comment

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

👍

Updates the Credentials type's cache of the CredentialsValue to be
synchronized with an atomic value in addition to the Mutex. This reduces
the overhead applications will encounter when many concurrent API
requests are being made.

Benchmarks of SafeCredentialsProvider.Retrieve improvements. This will
be the normal case until credentials expire. Each benchmark increases
the number of concurrent credential retrieves.

    benchmark                                                              old ns/op     new ns/op     delta
    BenchmarkSafeCredentialsProvider_Retrieve/1-4                          72.3          26.1          -63.90%
    BenchmarkSafeCredentialsProvider_Retrieve/10-4                         1055          121           -88.53%
    BenchmarkSafeCredentialsProvider_Retrieve/100-4                        15720         1216          -92.26%
    BenchmarkSafeCredentialsProvider_Retrieve/500-4                        65662         6194          -90.57%
    BenchmarkSafeCredentialsProvider_Retrieve/1000-4                       121962        12673         -89.61%
    BenchmarkSafeCredentialsProvider_Retrieve/10000-4                      9958536       127224        -98.72%

Benchmark of SafeCredentialsProvider.Retrieve with the credentials
periodically expiring.  The {rate}-{concurrent} benchmarks will expire
the credentials every {rate} attempts to get credentials, with
{concurrent} credential getters.

    benchmark                                                              old ns/op     new ns/op     delta
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-1-4         223           171           -23.32%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-10-4        1527          313           -79.50%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-100-4       14528         1779          -87.75%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-500-4       89016         7764          -91.28%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-1000-4      151669        14048         -90.74%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/10000-10000-4     10024041      201702        -97.99%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-1-4          1450          1423          -1.86%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-10-4         3043          1483          -51.27%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-100-4        24763         2956          -88.06%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-500-4        68852         8801          -87.22%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-1000-4       121360        15952         -86.86%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/1000-10000-4      2133773       177960        -91.66%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-1-4           13688         13012         -4.94%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-10-4          15560         13239         -14.92%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-100-4         35299         15879         -55.02%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-500-4         110204        20949         -80.99%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-1000-4        259354        31070         -88.02%
    BenchmarkSafeCredentialsProvider_Retrieve_Invalidate/100-10000-4       7847174       196509        -97.50%
@jasdel jasdel merged commit b82e064 into aws:master Jun 6, 2018
@jasdel jasdel deleted the enc/CredsRWLock branch June 6, 2018 21:27
jasdel added a commit to jasdel/aws-sdk-go-v2 that referenced this pull request Sep 27, 2018
* Synced the V2 SDK with latests AWS service API definitions.

* Fix SDK Go 1.11 connection reset handling (aws#207)
	* Fixes how the SDK checks for connection reset errors when making API calls to be compatiable with Go 1.11.
* `aws/signer/v4`: Fix X-Amz-Content-Sha256 being in to query for presign (aws#188)
	* Fixes the bug which would allow the X-Amz-Content-Sha256 header to be promoted to the query string when presigning a S3 request.  This bug also was preventing users from setting their own sha256 value for a presigned URL. Presigned requests generated with the custom sha256 would of always failed with invalid signature.
	* Related to aws/aws-sdk-go#1974

* Cleanup SDK README and example documenation.
* `service/s3/s3manager`: Add doc for sequential download (aws#201)
	Adds documentation for downloading object sequentially with the S3 download manager.
* `aws/credentials`: Update Credentials cache to have less overhead (aws#184)
	* Updates the Credentials type's cache of the CredentialsValue to be synchronized with an atomic value in addition to the Mutex. This reduces the overhead applications will encounter when many concurrent API requests are being made.
	* Related to: aws/aws-sdk-go#1973
* `service/dynamodb/dynamodbattribute`: Add support for custom struct tag keys (aws#203)
	* Adds support for (un)marshaling Go types using custom struct tag keys. The new `MarshalOptions.TagKey` allows the user to specify the tag key to use when (un)marshaling struct fields.  Adds support for struct tags such as `yaml`, `toml`, etc. Support for these keys are in name only, and require the tag value format and values to be supported by the package's Marshalers.
* `internal/ini`: Add custom INI parser for shared config/credentials file (aws#209)
	* Related to: aws/aws-sdk-go#2024
jasdel added a commit that referenced this pull request Sep 27, 2018
### Services
* Synced the V2 SDK with latests AWS service API definitions.

### SDK Bugs
* Fix SDK Go 1.11 connection reset handling (#207)
	* Fixes how the SDK checks for connection reset errors when making API calls to be compatible with Go 1.11.
* `aws/signer/v4`: Fix X-Amz-Content-Sha256 being in to query for presign (#188)
	* Fixes the bug which would allow the X-Amz-Content-Sha256 header to be promoted to the query string when presigning a S3 request.  This bug also was preventing users from setting their own sha256 value for a presigned URL. Presigned requests generated with the custom sha256 would of always failed with invalid signature.
	* Related to aws/aws-sdk-go#1974

### SDK Enhancements
* Cleanup SDK README and example documentation.
* `service/s3/s3manager`: Add doc for sequential download (#201)
	Adds documentation for downloading object sequentially with the S3 download manager.
* `aws/credentials`: Update Credentials cache to have less overhead (#184)
	* Updates the Credentials type's cache of the CredentialsValue to be synchronized with an atomic value in addition to the Mutex. This reduces the overhead applications will encounter when many concurrent API requests are being made.
	* Related to: aws/aws-sdk-go#1973
* `service/dynamodb/dynamodbattribute`: Add support for custom struct tag keys (#203)
	* Adds support for (un)marshaling Go types using custom struct tag keys. The new `MarshalOptions.TagKey` allows the user to specify the tag key to use when (un)marshaling struct fields.  Adds support for struct tags such as `yaml`, `toml`, etc. Support for these keys are in name only, and require the tag value format and values to be supported by the package's Marshalers.
* `internal/ini`: Add custom INI parser for shared config/credentials file (#209)
	* Related to: aws/aws-sdk-go#2024
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