- Newest
- Most votes
- Most comments
Hello,
I understand that you are working on POC to measure Step Function response time, while invoking Step Function 1. from API Gateway and 2. from AWS SDK Java v2 running in EC2. After conducting multiple concurrency tests, you found that requests made from AWS SDK is taking slightly longer than via API Gateway.
In order to investigate this issue, we need to know what is the EC2 instance type and where is the API Gateway hosted. Are you using AWS API Gateway or third-party API. You mentioned with single request, SDK performs better, therefore the latency could be related to EC2 capacity. Generally, using larger EC2 instance type will provide higher capacity and faster processing. Have you already tested by using different EC2 instance types for benchmarking. Finally, what is the network path from EC2 to Step function, is it traversing via Private Link using VPC endpoint or through public Internet.
We recommend using X-ray service with Step function to determine latency of request, for your state machine. X-Ray will meter invocation time, state transition time, the overall execution time of Step Functions, and variances in this execution time. X-ray provides Visualization and Analysis tool to accurately trace Step function request. You can also integrate X-ray with AWS API Gateway and AWS SDK for end to end latency tracing.
For optimization, you can consider using Map state or Parallel state for concurrent executions, if applicable for your use case.
Please feel free to follow up with any additional questions or concerns.
Relevant content
- asked 2 years ago
- asked 9 months ago
- asked 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 4 months ago
- AWS OFFICIALUpdated a year ago
I am using t2.xlarge EC2 instance type for both tests and using AWS API gateway. And the network path from EC2 to Step function is via Private link using VPC . Its not using public internet. As far as using Map state or Parallel state is concerned, it is not relevant to our use case , so it cannot be used. I did try using x ray service for both tests , and found that execution of step function response time is very small fraction of total response time. It is not the cause of latency in both cases. Still not sure what could be the reason for latency in aws sdk.