amazon-web-serviceswebamazon-ec2servicereboot

Auto Reboot EC2 Micro


Hi I'm cheap and use the EC2 Micro Instance with 1 ip to run my programs which need to be nearly 24/7. I usually experience very bad performance after 2 hours of running and was wondering if there was some way to automatically reboot every 2 hours. I really only need to run to 2 scripts after the server comes back on. Is there anyway to do this?


Solution

  • I usually experience very bad performance after 2 hours of running and was wondering if there was some way to automatically reboot every 2 hours.

    I think the first thing that you should consider is why does the ec2 machine 'slows down' after 2hours. I have been using the micro instances for quite some time and I never experience poor performance. Use tools like top and htop to scan for memory-hungry programs and make sure that every process is executing within its domains.

    Secondly, if you want to schedule a re-boot of the machine, I would recommend using cron jobs for it. If you absolutely must scheule your machine on every 2hours or so, simply write up cron job inside the file /etc/crontab and refer to this document for specifying time