SQS first send message command 20x/30x slower than following ones #2427
-
Version of AWS SDK for PHP? Version of PHP ( Describe the question By running extra tests, I noticed that the latency of the first SQS message is 20x/30x slower than the ones that follow. In the attached image I created a script (which ran on an EC2 instance with IAM role enable to push message to the queue) which sends 800 messages to the queue, simple for loop with What I noticed it's an incredible high latency for the first SQS message. Every row it's an iteration of the for loop, hence a new message. You can also see the Partial time and the total time. Any idea? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @emdotem, since I already answered this issue here I will close this one. Basically, increasing the hop limit for ec2 instance from 1 to >1 should fix the issue. Basically, due that there hop limit defined for the ec2 instance metadata service is one, it will work fine from the ec2 instance, but if using docker, when resolving the credentials using the instance profile provider, the request to get the token from there will just time out ,with not responses. Then the secureMode variable is set to false here, which makes the credentials to be retrieved without the token option and the explains why we get valid credentials. So, the latency that you are experiencing is due that the request being made to retrieve the token is not going anywhere and the implementation waits for a timeout then. Here you can find information about httpPutResponseHopLimit. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @emdotem, since I already answered this issue here I will close this one. Basically, increasing the hop limit for ec2 instance from 1 to >1 should fix the issue. Basically, due that there hop limit defined for the ec2 instance metadata service is one, it will work fine from the ec2 instance, but if using docker, when resolving the credentials using the instance profile provider, the request to get the token from there will just time out ,with not responses. Then the secureMode variable is set to false here, which makes the credentials to be retrieved without the token option and the explains why we get valid credentials. So, the latency that you are experiencing is due that the request…