I am trying to run the locust application in one of my AWS gpu instances i.e; g4dnxlarge (not working) and I tried the same code in cpu instance in AWS i.e; m54xlarge. which is working here
When I initiate the call from the locust UI, it does not hit the API that is running in the AWS instance (g4dnxlarge) and I could successfully hit the API in m54xlarge AWS instance.
I am not sure on why I am facing this issue in g4dnxlarge instance where I am not facing this issue in m54xlarge instance
Can anyone tell me the issue?
below is the code
from locust import HttpUser, task, between
class MyUser(HttpUser):
wait_time = between(1, 5) # Adjust wait times as needed
@task
def generate_embeddings(self):
# Define the API endpoint URL
api_url = "/generate_embeddings" # Update with your API endpoint
# JSON payload with input_s3_uri
payload = {
"input_s3_uri": "s3://es-pf/images_new",
"batch_size": 1
}
# Send a POST request to the API
print('api_url: ')
print(api_url)
response = self.client.post(api_url, json=payload)
# Check the response status code
if response.status_code == 200:
print("API call successful")
else:
print("API call failed with status code:", response.status_code)
