I'm using the AWS SDK for PHP v3.
I'm calling searchPlaceIndexForText
I can call this service without a problem and get my GeoIPs, and I've used both ESDI and HERE indexes successfully.
My problem: When I run my script from the command line locally (on my own computer), the CLI responds in an average of ~500ms, which is very acceptable.
However, when I deploy the same code to an EC2 and run the same code, the latency is at a minimum of 1.5 seconds (1500ms) up to sometimes 5000ms (5 seconds).
The address and everything else are the same. I've also tried setting the BiasPosition, and the results are the same.
Other info: my EC2 is located in us-west-2 region, and I'm physically located in AZ
Code snippet:
$locationClient = new Aws\LocationService\LocationServiceClient([
'version' => 'latest',
'region' => 'us-west-2',
]);
$result = $locationClient->searchPlaceIndexForText(
[
'FilterCategories' => ['AddressType'],
'IndexName' => 'MyHereIndex', // REQUIRED
'Text' => '587 S Watson Rd, Buckeye, AZ 85326', // REQUIRED
]);
What is the latency if you login to the EC2 instance and run the script from the command line on the EC2 instance? i.e. an apples-to-apples comparison to running from your own computer as opposed to deploying the PHP app.