- Newest
- Most votes
- Most comments
Hello!
Just a few questions to help us troubleshoot this problem.
- What kind of process do you run? Is it IO/CPU intensive?
- What type of instance do you use and what OS?
- If you do not close terminal and browser does process run with no interruption even after some time?
- Approximately after what period of time process stops?
Thanks!
- The process uses about 1% of the CPU.
- I use a t2.micro instance which uses Amazon Linux.
- Yes, with the terminal and browser open, I have not experienced any interruptions in the process. I've had the browser open for up to 8 hours, and it works smoothly the whole time.
- I'm not sure exactly how long. My best guess is within a few hours at most.
By the way, apparently I can only make one post per day, so if you ask more questions I will not be able to respond for another 24 hours.
Edited by: ineedhelpbadly on Aug 14, 2019 8:15 AM
Thanks for details!
One more questions: when you close your IDE and then after some time returns to it, does your EC2 instance stops and starts again? Or is it running? You can see that instance was stopped if on loading screen for Cloud9 you will see that Cloud9 attempts to starts EC2 instance.
The EC2 instance continues to run. I can also SSH into my instance at any time and it is always running. by SSH-ing directly into the instance and running the script with
nohup python script-name.py &
, I can now get the script to run for about 24 hours before it stops running.
Hi, can you please explain what your script is doing or, if possible, add python script to this thread.
Here are a few things I would recommend to help debug..
1. launch to see stdout/stderr output - nohup python script-name.py > /tmp/nohup.out&
2. If you don't have try/except/finally blocks around the code, add them to help debug and handle any unexpected exceptions (if an exception is causing it to die)
3. Is it possible your script is running out of resources and dying? For example, maybe "Too many open files" because your script is not closing file handles? (ulimit -n shows 4,096 max files in cloud9 by default).
4. Does your python script just run in a loop performing things every X minutes? If yes, maybe consider creating a scheduled cron job that just runs the script every X minutes.
5. If your python script is running as a "server" accepting connections, can you run it as a daemon?
6. Try launching your python script on a regular EC2 instance to see if you can reproduce the problem there.
-randy
Relevant content
- asked 2 years ago
- asked 5 months ago
- asked a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 8 months ago