Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6145311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:46:34+00:00 2026-05-23T18:46:34+00:00

I have a periodic task that I need to run on the EC2. This

  • 0

I have a periodic task that I need to run on the EC2. This task will not take more than 10 minutes to run and I do not want to end up paying for the other 50 minutes that this task will be idle for. From my understanding, if I start an instance and run this task, no matter whether I use any resources or not, I will be billed for my usage. So I was looking to do something on the following lines every 60 minutes or so (just a high-level sketch):

def invokeTimer(i):
   if timer(i) expired:
      copyDataFromNode(i)
      killNode(i)

while True:
   for i in range(1,10):
      startNode(i)
      # Allow the node to boot up
      startScript(i)
      invokeTimer(i)
   sleep(60000)

Assuming that I was able to convey my idea, is there a good way of implementing this in a clean fashion or perhaps a tutorial that could be of help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T18:46:35+00:00Added an answer on May 23, 2026 at 6:46 pm

    You will pay for the full hour no matter what you do.

    As soon as you start an EC2 instance (you refer to them as nodes, but that’s wrong), you pay for an hour. Any partial hour is billed as a full hour.

    If you snap an AMI (backup image) of a machine, you have to pay for the EBS volume, so there is a cost there as well.

    Your best bet is to use spot instances to save some money over regular instances.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a long-running process that must run every five minutes, but more than
Requirement - I have a periodic task I want to run in a Windows
I have some periodic tasks that I run with celery (daemonized by supervisord), but
I have created a list of plots that I want to run as a
I now need to design a chemistry periodic table. I will have a set
I have an application that records data from a manufacturing process on a periodic
I have a Windows Service that performs a number of periodic activities, and I
I have objects that have comments. As part of a periodic email summary, I
I have a process that needs to do periodic processing on an ever-growing logfile.
I have a periodic task scheduled via Spring TaskScheduler.schedule(Runnable, Trigger) . Given the returned

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.