By using AWS re:Post, you agree to the AWS re:Post Terms of Use

Rate limit for Sagemaker ListTags API endpoint

0

Hi,

I'm calling the SageMaker ListTags API endpoint (https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_ListTags.html) via the AWS SDK for Java (version 2.25.70) and I'm getting the exception as below. I see that it's coming from the call to DefaultSageMakerClient.listTags, thus the ListTags API endpoint above. My question is: does anyone know what the rate-limit is for that endpoint? I can't find it in the documentation.

I have some strategies in mind for how I can reduce the number of calls I'm making, but it would be useful to know what the actual limit is so that I can ensure I stay under it.

Thanks,

Jamie

software.amazon.awssdk.services.sagemaker.model.SageMakerException: Rate exceeded (Service: SageMaker, Status Code: 400, Request ID: redacted)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleErrorResponse(CombinedResponseHandler.java:125)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handleResponse(CombinedResponseHandler.java:82)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:60)
	at software.amazon.awssdk.core.internal.http.CombinedResponseHandler.handle(CombinedResponseHandler.java:41)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.HandleResponseStage.execute(HandleResponseStage.java:38)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:72)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptTimeoutTrackingStage.execute(ApiCallAttemptTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:78)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.TimeoutExceptionHandlingStage.execute(TimeoutExceptionHandlingStage.java:40)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:55)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallAttemptMetricCollectionStage.execute(ApiCallAttemptMetricCollectionStage.java:39)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:81)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.RetryableStage.execute(RetryableStage.java:36)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:56)
	at software.amazon.awssdk.core.internal.http.StreamManagingStage.execute(StreamManagingStage.java:36)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.executeWithTimer(ApiCallTimeoutTrackingStage.java:80)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:60)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallTimeoutTrackingStage.execute(ApiCallTimeoutTrackingStage.java:42)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:50)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ApiCallMetricCollectionStage.execute(ApiCallMetricCollectionStage.java:32)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.RequestPipelineBuilder$ComposingRequestPipelineStage.execute(RequestPipelineBuilder.java:206)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:37)
	at software.amazon.awssdk.core.internal.http.pipeline.stages.ExecutionFailureExceptionReportingStage.execute(ExecutionFailureExceptionReportingStage.java:26)
	at software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient$RequestExecutionBuilderImpl.execute(AmazonSyncHttpClient.java:224)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.invoke(BaseSyncClientHandler.java:103)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.doExecute(BaseSyncClientHandler.java:173)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.lambda$execute$1(BaseSyncClientHandler.java:80)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.measureApiCallSuccess(BaseSyncClientHandler.java:182)
	at software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler.execute(BaseSyncClientHandler.java:74)
	at software.amazon.awssdk.core.client.handler.SdkSyncClientHandler.execute(SdkSyncClientHandler.java:45)
	at software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler.execute(AwsSyncClientHandler.java:53)
	at software.amazon.awssdk.services.sagemaker.DefaultSageMakerClient.listTags(DefaultSageMakerClient.java:15145)
asked 20 days ago37 views
1 Answer
-1

While the exact rate limit for the SageMaker ListTags API endpoint is not explicitly stated in the documentation, there are some important points to consider regarding API usage and limits:

  1. The ListTags operation in Amazon SageMaker does have a maximum number of results that can be returned in a single request. You can specify this using the MaxResults parameter, which has a valid range from 1 to 50. If you don't specify a value, SageMaker will use a default.

  2. To retrieve additional results beyond the maximum, you can use pagination. The API returns a NextToken if there are more results available. You can use this token in subsequent requests to retrieve the next set of tags.

  3. While there isn't a specific rate limit mentioned for the ListTags API, AWS services generally have service quotas and throttling limits to prevent excessive use. These limits can vary based on the specific service, region, and account.

  4. The error message you're receiving ("Rate exceeded") suggests that you're hitting a rate limit, which could be related to the frequency of your API calls or the overall number of requests within a certain time frame.

To address this issue and stay within the limits:

  1. Implement exponential backoff and retry logic in your code to handle rate limit errors.
  2. Consider caching tag information where possible to reduce the number of API calls.
  3. If you're making multiple requests in quick succession, try adding small delays between calls.
  4. Use the MaxResults parameter effectively to minimize the number of API calls needed.
  5. If you consistently hit rate limits, you may want to contact AWS support to discuss your use case and potentially request a limit increase if necessary.

Remember that while these strategies can help manage your API usage, it's important to design your application to work within the service's limits and handle potential throttling gracefully.
Sources
ListTags - Amazon SageMaker
AsyncInferenceClientConfig - Amazon SageMaker

profile picture
answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions