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 8930041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:47:48+00:00 2026-06-15T08:47:48+00:00

I am executing the following code 25 times before calling commit (very abbreviated). def

  • 0

I am executing the following code 25 times before calling commit (very abbreviated).

def query_and_insert(conn):
    c = conn.cursor()
    result = c.execute("SELECT ...")
    result = modify_result(result)
    c.execute("INSERT ...".format(result))
    result.close()

if __name__ == "__main__":
    conn = MySQLDB.connect(...)
    loop 25 times:
        query_and_insert(conn)
    conn.commit()
    conn.close()

After the first 15 or so queries, the speed slows down significantly (goes from < 1 second per query/insert combo to > 20 seconds). The problem definitely isn’t the complexity of the queries I’m executing; moving the last 10 queries to the beginning has them running just as fast, and then the last queries again slow down significantly.

Is there some sort of throttling or decreased priority for processes that take too long on AWS? Is there any way around this?

Edit: We are using a MicroInstance on Amazon EC2. There is no issue with building table size because we are doing the inserts on an empty table.

  • 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-06-15T08:47:49+00:00Added an answer on June 15, 2026 at 8:47 am

    What you’re describing is normal behavior for micro instances. See more in the Micro Instances documentation. In short, micro instances have access to a fair amount of CPU — but once you’ve used it for more than a very brief period, you get throttled hard. If this is adversely affecting your application, then it’s simply not a good fit for micro instances, which are intended for low-CPU applications and/or applications where users will not notice added latency.

    Micro instances are the only instances that are subject to this type of throttling, so upgrading to a m1.small would be one way out. Since every t1.micro instance is EBS-backed, can upgrade from the EC2 console by stopping the instance (not terminating), selecting a larger instance using “Change Instance Type”, and starting up again. This will result in a new internal IP/hostname, as well as a new public IP/hostname unless you’re using elastic IPs, but you’ll get consistent amounts of CPU.

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

Sidebar

Related Questions

When executing the following code: OpenFileDialog dialog = new OpenFileDialog(); DialogResult result = dialog.ShowDialog();
I am executing the following code: def takeN(s : String, n : Int): String
I am executing the following code to install SQL Server 2012 in silent mode.
If I try executing the following code f = file('test','rb') fout = file('test.out','wb') for
I am getting Incorrect syntax near the keyword 'select' after executing the following code.
I'm trying to play an mp3 audio file on iPhone executing the following code:
I'm finding it difficult to get started in Objective-C. I'm executing the following code
I get an exception while executing following piece of code bool FieldValueMessage::Get(const std::string &field,
The following code is executing perfectly but there is a mySQL error somewhere that
I'm executing the following piece of code: ActivityManager actvityManager = (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); List<RunningTaskInfo> procInfos

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.