Aws-sdk-java: EC2MetadataUtils is very slow after 1.11.678

Created on 25 Mar 2020  路  3Comments  路  Source: aws/aws-sdk-java

On 1.11.678 release, the EC2CredentialsUtils was replaced with InstanceMetadataServiceResourceFetcher.

A call to EC2MetadataUtils.getInstanceInfo() which used to last a few milliseconds, now takes a few seconds! On 1.11.678 it takes 10 seconds to respond, while on 1.11.749 it is quite better, but still it takes 2 seconds.

Is this something related to Metadata Service Version 2, or the SDK itself? If this is by design the way it works and the latency issue can not be fixed, we should at least be given the option to use the v1 service via the SDK.

service-api

Most helpful comment

Hi @kliakos yes, this is related to the Instance Metadata Service V2 change, we have multiple reports of increased latency when calling the new service. We've opened an internal ticket to the EC2 team behind the Metadata Service and they are investigating.

Not mentioning this change in the CHANGELOG was a miss in our part.

I'll update here when we hear back from the EC2 team.

All 3 comments

Moreover, nothing was mentioned about this modification on the 1.11.678 release notes.

https://github.com/aws/aws-sdk-java/blob/master/CHANGELOG.md#111678-2019-11-19

Tried aws-sdk-java-v2, but with no luck. Still the EC2MetadataUtils.getInstanceInfo() takes a second at least.

Hi @kliakos yes, this is related to the Instance Metadata Service V2 change, we have multiple reports of increased latency when calling the new service. We've opened an internal ticket to the EC2 team behind the Metadata Service and they are investigating.

Not mentioning this change in the CHANGELOG was a miss in our part.

I'll update here when we hear back from the EC2 team.

Was this page helpful?
0 / 5 - 0 ratings