Socket hang up while running large sized file in ec2 instance

0

I am a free tier subscription plan user. I am working with ec2 instance where I am running python code. The python code calls openai API for getting response. The response time varies with the size of my input data so whenever I have a big input data then openai API will take take more time to generate response. But after some time, the server gets timed out and the response is "Error: socket hang up". The output from ec2 server is the following:[2023-08-04 06:52:41 +0000] [4135] [CRITICAL] WORKER TIMEOUT (pid:4136) [2023-08-04 06:52:41 +0000] [4136] [INFO] Worker exiting (pid: 4136) [2023-08-04 06:52:42 +0000] [4135] [ERROR] Worker (pid:4136) exited with code 1 [2023-08-04 06:52:42 +0000] [4135] [ERROR] Worker (pid:4136) exited with code 1. [2023-08-04 06:52:42 +0000] [4195] [INFO] Booting worker with pid: 4195

But, it works fine with smaller files of size 4 KB. So my question, is free subscription plan causing this problem?

Thank you.

noteMan
asked 9 months ago281 views
1 Answer
0

I'd suggest you to check the cloudwatch metrics for this instance, most likely this seems to be either memory or CPU utilization issue.

Here is how you can view cloudwatch metrics for your EC2 instances. Additionally, here is the list of available metrics for EC2 instance, which may help you to further troubleshoot the issue.

If you see high CPU or memory utilization then I'd say, It's not the subscription plan but instance configuration, which is causing the issue. I understand, you want to utilize free tier eligible instance, but if instance is getting highly utilized for your use case then you may need to consider an instance with higher configuration which may not be eligible for free tier.

Hope you find this helpful.

Comment here if you have additional questions, happy to help.

Abhishek

profile pictureAWS
EXPERT
answered 9 months ago
  • Do you have any further questions, happy to help.

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