By using AWS re:Post, you agree to the Terms of Use

Python code stops automatically on Ec2


Hi, I am running a python code which uses API from a broker platform for a trading strategy. The code runs for hours on personal machine but when I run from an EC2 instance it stops automatically in 2-4 hours without any error. this has happened 3 times now. i saw some 54 updates to be applied on the ubuntu instance, have upgraded all and rebooted the system. Even then issue remains. pls help

asked 5 months ago30 views
1 Answer

I don't think it's possible to answer the question given the information available. if the code is running fine and stops without error then it is exiting normally. You'll need to add some debugging and logging to determine what is happening.

profile picture
answered 5 months ago
  • Hi Brettski, thanks for the response. the code is in while True as it keeps on running till the markets are closed which will 12 midnight India. I do have the complete logs and it keeps on writing to a log file. The log shows the code output but doesnt show any error. abruptly the code and screen stops on AWS. If i see cloudWatch metrics theres highs on NetworkIn. can it be cause of I am writing continuously on a file and AWS doesn't give me that space. i am on t2.large instance. i checked syslog and kernel log etc but there are no errors

  • I'm not a career software developer but it sounds iike there is some component that you're using which is exiting without error. If it were me, I'd be enabling more logging and debug output to try and determine where the interruption is happening.

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